Number Base Converter
Instantly convert between decimal, binary, hexadecimal, and octal
What is Base Conversion?
A number base (or radix) determines how many unique digits are used to represent numbers. The most familiar is base 10 (decimal), which uses digits 0–9. Computers and digital systems rely heavily on other bases for storage and communication.
The Four Most Common Bases
- Decimal (Base 10) — The standard counting system used in everyday life. Ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
- Binary (Base 2) — The native language of computers. Only two digits: 0 and 1. Each digit represents a single bit, the smallest unit of data.
- Hexadecimal (Base 16) — Uses digits 0–9 and letters A–F. Extremely compact: a single hex digit represents 4 binary bits. Used for color codes, memory addresses, and byte values.
- Octal (Base 8) — Uses digits 0–7. Each octal digit maps to 3 binary bits.
Historically common in Unix file permissions (e.g.,
chmod 755).
Why Does Base Conversion Matter?
Understanding base conversion is fundamental to computer science.
Memory addresses are written in hex, network masks in binary, and file permissions in octal.
Web developers use hex color codes like #FF5733 daily.
Cryptographic hashes and checksums are typically expressed as hexadecimal strings.
Knowing how bases relate to each other makes debugging, reverse engineering, and low-level
programming significantly easier.
Quick Reference: 0–15 in All Four Bases
This table shows the same values expressed in decimal, binary, hexadecimal, and octal — the most commonly needed range when working with 4-bit nibbles.
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 8 | 10 |
| 9 | 1001 | 9 | 11 |
| 10 | 1010 | A | 12 |
| 11 | 1011 | B | 13 |
| 12 | 1100 | C | 14 |
| 13 | 1101 | D | 15 |
| 14 | 1110 | E | 16 |
| 15 | 1111 | F | 17 |
Common Conversions Reference
Hex Color Codes
Web colors are written as three hex byte pairs (RRGGBB), each from 00 to FF.
| Color | Hex | Red (Dec) | Green (Dec) | Blue (Dec) |
|---|---|---|---|---|
| White | #FFFFFF | 255 | 255 | 255 |
| Black | #000000 | 0 | 0 | 0 |
| Red | #FF0000 | 255 | 0 | 0 |
| Lime | #00FF00 | 0 | 255 | 0 |
| Blue | #0000FF | 0 | 0 | 255 |
| Yellow | #FFFF00 | 255 | 255 | 0 |
| Cyan | #00FFFF | 0 | 255 | 255 |
| Magenta | #FF00FF | 255 | 0 | 255 |
Common Binary Patterns
| Pattern | Binary | Decimal | Hex | Meaning |
|---|---|---|---|---|
| All zeros (byte) | 00000000 | 0 | 00 | Null / off |
| All ones (byte) | 11111111 | 255 | FF | Full / max byte |
| High nibble set | 11110000 | 240 | F0 | Upper 4 bits |
| Low nibble set | 00001111 | 15 | 0F | Lower 4 bits |
| Powers of 2 — 1 | 01111111 | 127 | 7F | Max signed byte |
| Unix rwxr-xr-x | 111101101 | 493 | 1ED | Octal 755 |
Frequently Asked Questions
chmod 755 sets permissions using octal digits — 7 (rwx), 5 (r-x), 5 (r-x) for owner, group, and others respectively.