Number Base Converter
Convert numbers between binary, octal, decimal, hex, and any base from 2 to 36. BigInt-safe for large values. Free, in-browser.
What this does
Converts numbers between bases — binary (2), octal (8), decimal (10), hexadecimal (16), and any custom base from 2 through 36. Edit any field and the others update live.
Built on JavaScript BigInt so very large numbers convert without precision loss. parseInt(x, 16) runs out of precision around 2⁵³; this tool handles values into the thousands of digits.
Prefixes accepted
- Binary input may start with
0b(0b1010= 10). - Octal input may start with
0o(0o777= 511). - Hex input may start with
0x(0xFF= 255). - All bases accept negative values with leading
-.
Output is plain digits (no prefix) — copy-paste into your code with whatever prefix your language wants.
Common conversions you’ll need
| Decimal | Binary | Octal | Hex | What it represents |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | False / null byte |
| 255 | 11111111 | 377 | FF | Single byte max, IP octet, RGB channel |
| 256 | 100000000 | 400 | 100 | First overflow into 9 bits |
| 1023 | 1111111111 | 1777 | 3FF | Common /22 subnet size, 10-bit max |
| 1024 | 10000000000 | 2000 | 400 | 1 KiB |
| 65535 | 1111111111111111 | 177777 | FFFF | 16-bit max, 2-byte uint, port number max |
| 2147483647 | 1111…11 (31 ones) | 17777777777 | 7FFFFFFF | int32 max |
| 4294967295 | 1111…11 (32 ones) | 37777777777 | FFFFFFFF | uint32 max |
When you actually use this
- Reading hex dumps. A debugger shows
0x7FE3— what bit pattern is that? Convert to binary. - Setting register bits. “Bit 5 of register 0xFF22 should be 1.” Decimal 32 in binary
100000shows you the bit position. - CSS color RGB ↔ hex.
rgb(124, 58, 237)→#7C3AED. Three decimal-to-hex conversions. - File mode bits. chmod 755 in octal is
rwxr-xr-x; the binary111101101shows which permission bits are set. (For chmod specifically, see our chmod calculator .) - Subnet math.
/24netmask is255.255.255.0— the binary11111111…0makes the prefix length obvious. - Base-36 short IDs. Encoding a numeric ID in base 36 gives compact alphanumeric IDs (
xkcd1→1610393). Useful for URL shorteners. - Reading ASCII codes.
'A'is 65 decimal, 0x41 hex, 0b01000001 binary.
Bases above 16
Bases 17 through 36 use letters g–z for digit values 16–35. Common cases:
- Base 32 — without confusing characters (no I, L, O, U). Used by Crockford’s base32, ULIDs.
- Base 36 —
0–9+a–z. Compact alphanumeric IDs without case sensitivity. Doubles down: a 64-bit number fits in 13 base-36 chars (vs 16 hex chars). - Base 62 — would add uppercase but JavaScript
Number.toString(62)doesn’t support it natively. Beyond what this tool does (we cap at 36).
What this does NOT do
- Floating-point conversion. This tool is for integers only. Hex floats (
0x1.8p+1) and IEEE 754 inspection need a different tool. - Two’s complement / signed binary representation. Negative inputs use
-prefix on positive magnitude. To see the actual bit pattern of a negative int32, that’s a different conversion (we’d need a fixed bit-width input). - Arbitrary-precision floats.
BigIntis integer-only.
Privacy
Runs entirely in your browser. Your numbers stay local.