Skip to main content
HSCalculadora

Number Base Converter

Convert numbers between binary, octal, decimal and hex.

Use digits valid for the source base (0-9, A-F)

Results update as you type.

Converted value
—
Decimal value—

How it works

Every whole number can be written in many different bases, and this number base converter translates a value from any of the four most common bases — binary, octal, decimal, and hexadecimal — into any other. Base ten, the decimal system everyone learns first, uses ten digits and place values that are powers of ten. Computers, however, work in base two, or binary, where the only digits are 0 and 1, and programmers frequently use base sixteen, or hexadecimal, because it packs four binary digits into a single compact symbol using 0 through 9 and the letters A through F. The tool converts by first interpreting your input in its stated source base to recover the underlying quantity, then expressing that same quantity in the chosen target base. It also shows the plain decimal value so you can sanity-check the result. This is indispensable when reading memory addresses, colour codes such as the hex triples used in web design, network masks, file permissions, or the low-level output of debuggers and assemblers. Enter a value, pick the base it is written in and the base you want, and the conversion is instant.

Formula

value(from-base) → decimal → value(to-base)

Base conversion works in two steps. First the source string is read as a positional number in its own base, where each digit is multiplied by the base raised to the power of its position, and those products are summed to give a plain decimal value. Then that decimal value is repeatedly divided by the target base, and the remainders, read in reverse, become the digits of the answer. Hexadecimal uses the letters A to F for the values ten to fifteen.

Source:Positional number systems

We review all our tools from time to time to ensure accuracy.

Worked example

Value:255From base:10To base:16
255 in decimal = FF in hexadecimal (15 × 16 + 15).

How to use this calculator

  1. 1

    Enter your values

    Enter value, from base and to base.

  2. 2

    Adjust the options

    Fine-tune any options to match your situation.

  3. 3

    Read your result

    Converted value updates instantly as you type — no button to press.

Frequently asked questions

How do I convert binary to decimal?

Set the source base to binary and the target base to decimal, then enter the string of ones and zeros. Each digit is multiplied by two raised to the power of its position counting from the right starting at zero, and the products are added together. For example, 1010 in binary is eight plus zero plus two plus zero, which equals ten in decimal.

What is hexadecimal used for?

Hexadecimal, or base sixteen, is widely used in computing because each hex digit represents exactly four binary bits, making long binary values far more readable. Web colours like FF8800, memory addresses, MAC addresses, and byte values in debuggers are all written in hex. The digits run 0 through 9 and then A through F to represent the values ten through fifteen.

Why do programmers use binary and hex?

Digital hardware stores everything as on-or-off signals, which map naturally onto binary ones and zeros, so binary reflects how a computer actually works. Hexadecimal is a compact shorthand for binary because one hex digit equals four bits, so a single byte is just two hex digits. Together they let programmers read and write machine-level values without long, error-prone strings of bits.

Does this handle letters in hex input?

Yes. When the source base is hexadecimal you can enter the letters A through F in either upper or lower case alongside the digits 0 through 9, and the converter reads them as the values ten through fifteen. Output in hexadecimal is shown in upper case by convention. Entering a digit that is invalid for the chosen source base will not produce a meaningful result.

Can it convert fractions or decimals?

This converter works with whole numbers, which covers the overwhelming majority of programming and coursework needs such as addresses, colour codes, and byte values. Fractional values in non-decimal bases are far less common and follow a separate procedure involving repeated multiplication of the fractional part. For those cases you would use a dedicated fixed-point or floating-point conversion tool.