
Number Base Converter
Convert a number between binary, octal, decimal, and hexadecimal all at once. Pick the base of your input, type the value, and see every other base instantly. It uses arbitrary-precision arithmetic, so even huge numbers convert exactly with no rounding errors.
Binary (base 2)
11111111
Octal (base 8)
377
Decimal (base 10)
255
Hexadecimal (base 16)
FF
How to Use
Choose the base of the number you're entering — Binary, Octal, Decimal, or Hex — then type the value. The tool shows the equivalent in all four bases at once, each copyable with a click. Invalid digits for the chosen base are flagged so you can fix them.
Why This Tool Is Useful
Programmers work in different number bases all the time: hex for colors and memory addresses, binary for bit flags and permissions, decimal for everyday math. Converting between them by hand is error-prone, and many calculators lose precision on large values because they use floating-point numbers. This converter uses BigInt, so a 64-bit hex value or a long binary string converts exactly — no silent rounding.
Why Different Bases Exist
Computers store everything in binary (base 2) because transistors are on or off. Binary strings get long fast, so hexadecimal (base 16) is used as a compact shorthand — each hex digit maps to exactly four binary bits. Octal (base 8) plays a similar role and still appears in Unix file permissions. Decimal (base 10) is what humans count in.
Reading Hex and Binary
Hex digits run 0–9 then A–F, where A is 10 and F is 15. You'll see hex in color codes like #0284c7, in memory addresses, and in byte values. Binary uses only 0 and 1; grouping bits in fours makes them easier to read and maps cleanly onto a single hex digit.
Precision With Large Numbers
JavaScript's normal numbers lose accuracy above 2^53, which quietly corrupts large hex or binary values in many online converters. This tool parses and converts using BigInt, which has no size limit, so a full 64-bit value round-trips exactly. That matters when you're dealing with IDs, bitmasks, or addresses where every bit counts.
The Same Value in Four Bases
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 16 | 10000 | 20 | 10 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 1024 | 10000000000 | 2000 | 400 |