Number Base Converter
Convert numbers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). All four bases stay synced as you type.
menu_bookQuick Reference
| Dec | Bin | Oct | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 4 | 100 | 4 | 4 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 32 | 100000 | 40 | 20 |
| 64 | 1000000 | 100 | 40 |
| 128 | 10000000 | 200 | 80 |
| 255 | 11111111 | 377 | FF |
lightbulbTip
Type in any field and all other bases update instantly. Only valid digits for each base are accepted (binary: 0-1, octal: 0-7, hex: 0-9 and A-F).
What is the Number Base Converter?
A number base converter translates an integer between the four bases that show up in computing: binary (base 2, the language of bits), octal (base 8, used in Unix file permissions), decimal (base 10, what humans read), and hexadecimal (base 16, the compact form of binary used for color codes, memory addresses, and byte values).
How to use the Number Base Converter
- 1
Type into any of the four fields
Drop a number into Decimal, Binary, Octal, or Hex. The other three update on every keystroke.
- 2
Watch the input validation
Each field rejects invalid characters. Binary accepts 0 and 1, Octal accepts 0-7, Hex accepts 0-9 and A-F.
- 3
Use the prefix as a hint
Each base shows its prefix (0b, 0o, 0x) as a label, the conventions you'd see in actual code. The input itself doesn't need the prefix.
- 4
Copy the form you need
Each row has a copy icon. Grab the binary representation for a hardware register, the hex for a color code, the octal for chmod.
Frequently Asked Questions
What number bases are supported?
Four: binary (base 2, digits 0-1), octal (base 8, digits 0-7), decimal (base 10, digits 0-9), hexadecimal (base 16, digits 0-9 and A-F). All four sync live, so changing any one field rewrites the other three.
How large of a number can I convert?
Up to JavaScript's safe integer limit, 2^53 - 1 (9,007,199,254,740,991). Beyond that, JavaScript's number type loses precision and the conversions can't stay exact. For typical use (color codes, file permissions, bit patterns) this is many orders of magnitude more than you need.
Can I type in any base and see all others?
Yes, that's the point. Type into any one of the four fields and the other three rewrite instantly. The active field highlights in primary color so you remember which one is the source of truth.