Number Base Converter
Convert numbers between binary, octal, decimal, hexadecimal and any base up to 36. The 0x, 0b and 0o prefixes are detected automatically, values are held as BigInt so 64-bit register dumps convert exactly instead of losing precision above 2^53, and each value is shown as both an unsigned and a two's-complement signed number at the register width you choose.
Converts as you type. Ctrl+Enter to re-run.
Guide & FAQ
Convert a hex dump, a permission mask or a register value between bases and read it as both signed and unsigned. Everything runs through BigInt, so a 64-bit value round-trips exactly - a converter built on JavaScript numbers silently loses precision above 2^53, which is exactly where register dumps and cryptographic constants live. The bit map breaks the value into bytes so you can check a flag field at a glance. Runs entirely in your browser.
What it does
- Converts between bases - binary, octal, decimal, hexadecimal and base 36, in any direction.
- Detects prefixes automatically: 0x for hex, 0b for binary, 0o for octal; or set the input base explicitly for bare digits.
- Shows the signed value in two's complement at 8, 16, 32 or 64-bit width alongside the unsigned one.
- Keeps full precision using BigInt, so values above 2^53 are exact.
- Breaks the value into bytes with a bit map, hex and decimal per byte, plus an ASCII reading.
- Converts a batch - paste a column of values for a conversion table.
When to use it
- Reading a hex value from a debugger, a core dump or a protocol trace.
- Working out what a bitmask or flag field actually sets.
- Converting a permission or mode value between octal and binary.
- Checking whether a 32-bit value is a large unsigned number or a negative signed one.
- Translating a colour, a hash prefix or an ID between hex and decimal.
- Producing base 36 identifiers for short URLs or compact codes.
How to use it
- Type a value with its prefix -
0xFF,0b1010,0o755- or bare digits with the input base set. - Choose a Register width to control the signed reading and the bit map.
- Read the conversions in the output panel; the note tells you if the value was truncated to that width.
- Open the Bit map tab for the per-byte breakdown.
- Paste several values on separate lines to convert them all at once.
FAQ
FAQ
- How do I convert hex to decimal? Paste the value with its 0x prefix (or set the input base to hexadecimal) and read the Decimal line. Values of any length convert exactly.
- How does two's complement work? In a fixed width the top bit carries the sign: the signed value equals the unsigned value minus 2^width when that bit is set. In 8 bits, 0xFF is 255 unsigned and -1 signed. Both readings are shown.
- Why do large hex values lose digits in a JavaScript console? Plain JavaScript numbers are IEEE-754 doubles and lose precision above 2^53. This converter uses BigInt throughout, which is why long values round-trip exactly here.
- What is base 36 used for? Digits plus letters give the shortest representation you can still type on a keyboard, which is why it appears in short URLs, invoice codes and compact identifiers.
- Can I convert a negative number? Yes - prefix it with a minus sign. The signed reading also shows how the value appears in two's complement at the selected width.
- Does it accept underscores or spaces in numbers? Yes. Separators such as 0xDEAD_BEEF or 1010 1010 are stripped before parsing, so you can paste values formatted for readability.
- Is my data uploaded? No. All conversion is arithmetic performed in your browser.
Runs locally in your browser. No uploads. Share links use an encrypted URL fragment.