🔟 Number Base Converter
255 = 0xff = 0o377 = 0b11111111, convert any number between bases 2, 8, 10 and 16, at any size, exactly.
parsed as base-10 · exact (BigInt, no precision loss)
How the number base converter works
The input parses digit-by-digit into a BigInt, JavaScript’s arbitrary-precision integer, then re-renders in all four bases. Each digit contributes its face value times the base raised to its position, counting from the right at position 0: in hex, 0xFF is 15×16¹ + 15×16⁰ = 255, and in binary 0b1101 is 8 + 4 + 0 + 1 = 13. BigInt is the point: ordinary JS numbers lose precision past 2⁵³, so a 64-bit value like a database ID or bitmask converts wrongly in naive tools. Prefixes (0x, 0b, 0o), spaces and _ separators in the input are accepted and ignored.
The sample decodes to a classic: 3735928559 = 0xDEADBEEF. Everyday uses: reading hex color/memory values, building permission bitmasks, converting Unix file modes (octal), and checking what a flag register means in binary.
Frequently asked questions
Why do other converters corrupt large numbers?
They use floating-point numbers, exact only to 2⁵³ (about 9×10¹⁵). Beyond that, trailing digits silently change. This tool uses BigInt, exact at any length.
What are the 0x, 0o and 0b prefixes?
Standard literal markers: 0x = hex, 0o = octal, 0b = binary, the same notation JS, Python and C-family languages use. The converter accepts and outputs them.
How do I read a binary number quickly?
Group bits in fours from the right, each group is exactly one hex digit (1101 = D). That is why programmers think in hex: it is compressed binary.
Does it handle negative numbers?
It converts magnitudes; interpretation of negatives (two's complement width) depends on your context, an 8-bit -1 and a 64-bit -1 differ. Convert the unsigned pattern and apply your width's convention.
Octal still exists?
Unix file permissions keep it alive: chmod 755 is octal for rwxr-xr-x. Otherwise you'll mostly meet hex and binary.
How do I convert decimal to hex by hand?
Repeatedly divide by 16 and read the remainders bottom-up. 255 ÷ 16 = 15 remainder 15 (F), then 15 ÷ 16 = 0 remainder 15 (F), giving FF. The tool does this instantly, but the remainder method works for any target base.
Which digits does each base use?
Base 2 uses 0-1, base 8 uses 0-7, base 10 uses 0-9, and base 16 uses 0-9 then A, F for values ten to fifteen. A digit outside its base (like an 8 in a binary number) is invalid input, and the converter will flag it.
How many bits is one hex digit?
Exactly 4 bits (a nibble), because one hex digit ranges over 16 values (0-F) and 2⁴ = 16. That means two hex digits make one byte (8 bits), which is why a byte value is always written as a two-character hex pair from 00 to FF.
Is hex case-sensitive?
No, the hex digits A, F and a, f mean the same values, so 0xFF and 0xff are identical. This converter accepts either case on input; the case you see in the output is just a display convention and does not change the number.