Number Base Converter
Convert between binary, decimal, hex, octal — instantly and free
Digits: 0 and 1
Digits: 0–7
Digits: 0–9
Digits: 0–9 and A–F
Read-only — 0–9 and A–V
Read-only — 0–9 and A–Z
Bit Length
Requires bits (fits in )
Signed Decimal
2's complement value:
Enable to view 2's complement signed value for the current bit width.
Reset
Clear all fields and start fresh.
Step-by-Step Conversion
1 Decimal → Binary
2 Decimal → Hexadecimal
100% Private
All conversions happen locally in your browser using JavaScript. No data is ever sent to any server.
Understanding Number Bases
Why computers speak binary, why developers love hex, and why all four bases matter
A number base (or radix) determines how many unique symbols a positional numeral system uses to represent numbers. The position of each digit carries a weight equal to a power of the base, making conversion between bases a fundamental skill in computer science and software development.
Binary (Base 2)
Uses only 0 and 1. Every piece of digital data — text, images, video — is ultimately stored as binary. Modern CPUs process billions of binary operations per second.
Octal (Base 8)
Uses digits 0–7. Each octal digit maps to exactly 3 binary bits. Still used today in Unix/Linux file permission masks — chmod 755 is octal notation.
Decimal (Base 10)
Uses digits 0–9. The number system humans naturally use, derived from counting on ten fingers. Computers convert all user-facing numbers to decimal for readability.
Hexadecimal (Base 16)
Uses digits 0–9 and letters A–F. One hex digit = 4 binary bits. Used everywhere in programming: memory addresses, color codes #FF5733, byte values, and debugging output.
Conversion Quick Reference
Common values across all four number bases at a glance
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 4 | 0100 | 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 |
Tip: Hexadecimal is the most programmer-friendly base — a full byte (0–255) fits in exactly two hex digits. That's why color codes like #RRGGBB use three pairs of hex digits, one per color channel.
How Base Conversion Works
The mathematics behind converting numbers between different bases
Any Base → Decimal
Multiply each digit by its positional value (base raised to the position index, starting from 0 on the right), then sum all results.
Binary 1011 → Decimal:
1 × 2³ = 8
0 × 2² = 0
1 × 2¹ = 2
1 × 2&sup0; = 1
Sum = 11
Decimal → Any Base
Repeatedly divide the decimal number by the target base, collecting remainders. Read the remainders bottom to top for the result.
Decimal 11 → Binary:
11 ÷ 2 = 5 remainder 1
5 ÷ 2 = 2 remainder 1
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1
Read up: 1011
Frequently Asked Questions
Common questions about number bases and this converter tool
chmod 755 uses octal: 7 = rwx (read/write/execute), 5 = r-x (read/execute). Each octal digit represents exactly 3 binary bits, making it convenient for grouping bits.