Number Base Conversion Calculator
Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 9/5/2026
To convert a decimal number, it is re-expressed by successively dividing by the target base (2 for binary, 8 for octal, 16 for hexadecimal). The number 255 is written 11111111 in binary, 377 in octal, and FF in hexadecimal.
Explanation
The decimal system, the one we use every day, counts in base 10 (ten digits, from 0 to 9). Computing commonly uses three other bases: binary (base 2, only 0 and 1), the most fundamental representation for a computer since it corresponds directly to the two possible electrical states of a circuit; hexadecimal (base 16, digits 0 to 9 then letters A to F for values 10 to 15), widely used to compactly represent binary values (web color codes, memory addresses, raw data), with each hexadecimal digit representing exactly 4 binary digits; and octal (base 8), less common today but still present in some historical contexts (Unix file permissions, for example). Converting a decimal number to another base amounts to breaking it down into successive powers of that base: 255 in binary is written 11111111 because 255 = 128+64+32+16+8+4+2+1 (the first eight powers of 2, from 2⁷ to 2⁰), a byte made entirely of 1s — the largest value representable on 8 bits. In hexadecimal, this same 255 is written FF, with F representing the value 15 in each of the two positions (15×16 + 15 = 255). This calculator limits the decimal number to 9,007,199,254,740,991 (2⁵³ − 1, the largest integer exactly representable in JavaScript), beyond which standard numeric precision no longer guarantees an exact result. Hexadecimal in particular is the everyday notation behind web colors: see our RGB/hex color converter for a direct application.
Example: converting 255
Inputs
Decimal number: 255.
Calculation
255 = 128+64+32+16+8+4+2+1 = 11111111 in binary. In hexadecimal, 255 = 15×16 + 15 = FF (F representing 15).
Result
255 is written 11111111 in binary, 377 in octal, and FF in hexadecimal.
Frequently asked questions
Why does hexadecimal use letters in addition to digits?
Because base 16 needs 16 distinct symbols to represent each "digit" of a number, but the decimal system only provides 10 (0 to 9). The six missing values (10 to 15) are conventionally represented by the letters A to F: A=10, B=11, C=12, D=13, E=14, F=15.
Why is hexadecimal so convenient for representing binary data?
Because a single hexadecimal digit corresponds to exactly 4 binary digits (2⁴ = 16), with no remainder or approximation. A full byte (8 bits) is therefore always written with exactly 2 hexadecimal digits, which makes converting between the two bases immediate and explains its widespread use for web color codes (#FF0000 for pure red) or memory addresses in computing.
Does this calculator also convert the other way (binary or hexadecimal to decimal)?
No, this calculator only starts from a decimal number to convert it to the three other bases. For the reverse conversion (for example, finding the decimal value of a hexadecimal code), a calculator dedicated to the reverse direction would be needed.
Where else does this binary/bit logic show up in everyday computing?
Data transfer rates are a good example: bits and bytes, the same base-2 units used here, are also the foundation of our data transfer rate converter, which converts between bits, bytes, kilobits and megabits per second — the units used to describe an internet connection's speed.