Number Base Converter
Convert between binary, octal, decimal, hex, and any base up to 36.
100% in your browser — nothing uploadedConvert binary to decimal and hexadecimal
Example loaded: 255, the largest unsigned byte. Type in any field and the others update instantly.
About this number base converter
Type a number into any field — binary, octal, decimal, or hexadecimal — and the others update instantly. A custom row converts to and from any base between 2 and 36, using the digits 0–9 and the letters a–z. Input is forgiving: prefixes like 0x, 0b, and 0o are understood, spaces and underscores are ignored, and negative numbers work everywhere. If a character doesn’t belong in the chosen base, a message under that field tells you exactly which one, and binary output can be grouped into 4-bit nibbles for easier reading. Each field has its own copy button, so the hex constant or bit mask you came for is one click away.
Because it uses BigInt arithmetic, there is no 32- or 64-bit ceiling: 128-bit values, hashes, and large IDs convert without losing a single digit — something ordinary calculators can’t do past 15 or 16 digits. It’s built for developers reading bitmasks and file permissions, students checking number-system homework, and engineers debugging embedded or network code. Like every Sofritools utility, it runs entirely in your browser: nothing you type is sent anywhere.
Why the base matters: negatives, permissions, and colors
Base conversion isn't academic — three everyday cases only click once you can read the raw digits.
A negative integer read back as hex looks alien until you know it's stored in two's complement. In 32 bits, -5 is 0xFFFFFFFB. To get there, take +5, flip every bit, then add one:
+5 = 0x00000005 = 0000 0000 ... 0000 0101
flip = 0xFFFFFFFA = 1111 1111 ... 1111 1010
+1 = 0xFFFFFFFB = 1111 1111 ... 1111 1011Unix file permissions are octal because each digit packs exactly three bits — read (4), write (2), execute (1) — for owner, group, and other in turn. That's why chmod 755 and 644 map cleanly to the rwx string ls shows:
| Octal | Binary | Symbolic | Means |
|---|---|---|---|
| 755 | 111 101 101 | rwxr-xr-x | owner all; group/other read + run |
| 644 | 110 100 100 | rw-r--r-- | owner read/write; others read |
| 600 | 110 000 000 | rw------- | owner only |
| 777 | 111 111 111 | rwxrwxrwx | everyone all (avoid) |
And a CSS color like #0b7a55 is just three 0–255 bytes in hex: R = 0x0b = 11, G = 0x7a = 122, B = 0x55 = 85. Split the six digits into pairs, convert each, and you have the exact RGB triplet — the same math the color tools run.
Reference tables
FAQ
Is there a maximum number size?
No practical one. The converter uses JavaScript BigInt, which supports arbitrary precision — 128-bit, 256-bit, or larger values convert exactly. Ordinary floating-point calculators silently lose precision above 2^53; this tool never does.
Can I paste values like 0xFF or 1_000_000?
Yes. The prefixes 0x (hex), 0b (binary), and 0o (octal) are stripped automatically in their matching fields, and spaces or underscores used as digit separators are ignored — so constants copied straight from code just work.
How do bases above 16 work?
Digits run 0–9 and then a–z, so base 36 uses all 26 letters: the digit z is worth 35. Letter case doesn’t matter on input. This covers things like base-36 short codes and URL shortener IDs.