Number Base Converter — Dec / Bin / Hex / Oct
Type a number in any base — decimal, binary, octal, hexadecimal — and see it converted instantly to the other three. Useful for programming, networking, low-level debugging.
Conversion runs in your browser.
Why convert between number bases?
Different domains in computing use different bases:
- Decimal (base 10) — everyday human counting.
- Binary (base 2) — how computers store everything internally; bitmasks, flags, low-level memory.
- Hexadecimal (base 16) — compact representation of binary; CSS colours, memory addresses, file content hex dumps, MAC addresses.
- Octal (base 8) — Unix file permissions (chmod 755), some embedded systems.
Quick reference
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 16 | 10000 | 20 | 10 |
| 64 | 1000000 | 100 | 40 |
| 255 | 11111111 | 377 | FF |
| 1024 | 10000000000 | 2000 | 400 |
| 65535 | 1111111111111111 | 177777 | FFFF |
Common use cases
- Programming bitwise operations — flags and masks are clearest in binary.
- CSS / web colours —
#FF0000is red; that's 255, 0, 0 in decimal. - Linux / Unix file permissions —
chmod 755is octal. - Networking — IP addresses, MAC addresses, port numbers all benefit from hex.
- Embedded development — registers and memory locations are typically hex.
- Debugging memory dumps — hex view of binary content.
- Cryptographic data — keys and digests are commonly expressed in hex.
Tips
- Hex is the most space-efficient human-readable representation of binary — every hex digit covers exactly 4 bits.
- Programming languages have prefixes:
0bfor binary,0ofor octal,0xfor hex. - For numbers above 2^53, JavaScript's number type loses precision; this converter has the same limit.
FAQs
Why does hex use letters A-F?
Because we need 16 distinct digits per place but only have 10 digit symbols (0-9). A=10, B=11, ..., F=15.
Why don't we just use decimal everywhere?
Computers are binary; hex is a more compact way to read binary; octal once mapped cleanly to 3-bit groups in early systems.
What's the maximum number?
2^53 − 1 (about 9 quadrillion). Beyond that, JavaScript's number type loses precision.
Is anything uploaded?
No.