Number Base Converter
Convert numbers between binary, octal, decimal and hexadecimal instantly. Free, private.
Type a number in any field — all other bases update instantly.
Number Base Reference
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 1 0000 | 20 | 10 |
| 255 | 1111 1111 | 377 | FF |
| 256 | 1 0000 0000 | 400 | 100 |
Why Hexadecimal in Programming?
Hex is popular because it maps cleanly to binary: each hex digit represents exactly 4 bits. A full byte (8 bits) is always two hex digits — making memory addresses, color codes and bitmasks far easier to read than their binary equivalents. 0xFF is immediately readable as "max byte value"; the binary equivalent 11111111 requires counting eight ones. CSS colors use hex (#1A2B3C), network masks use hex, and debug output from low-level tools is always hex.
When You Encounter Each Base
- Binary — CPU instruction sets, bitfields, permission flags (e.g. Unix file permissions), network protocol documentation, embedded systems.
- Octal — Unix file permission notation (
chmod 755= rwxr-xr-x), legacy systems, C/C++ octal literals (prefix0). - Decimal — everyday arithmetic, IP addresses in human-readable form, database integer IDs, all user-facing numbers.
- Hexadecimal — CSS colors, HTML color codes, memory addresses, SHA/MD5 hash outputs, UUID segments, HTTP headers, ASCII and Unicode code points.
Converting Between Bases by Hand
To convert decimal to binary: repeatedly divide by 2, write the remainders in reverse order. 13 ÷ 2 = 6 r1 → 3 r0 → 1 r1 → 0 r1, read remainders bottom to top: 1101. To convert binary to hex: group bits into sets of 4 from the right and replace each group with its hex digit. 1101 1010 → D and A → 0xDA.