Number base converter
Binary, octal, decimal and hexadecimal.
- Instant
- Free
- Private (processed locally)
- No sign-up
Understanding number bases
We usually count in base 10 (decimal), with ten digits from 0 to 9. But computers think in base 2 (binary), because a circuit only knows two states: 0 and 1. Other bases help write that data more readably: octal (base 8) and especially hexadecimal (base 16).
In any base, a digit’s position indicates a power of the base. In decimal, 235 = 2×10² + 3×10¹ + 5×10⁰. In hexadecimal, EB = 14×16 + 11 = 235. It is the same number, written differently.
How to use the converter
-
Enter a number
Type the value to convert, for example 255.
-
Choose its input base
State whether your number is decimal, binary, octal or hexadecimal.
-
Read all four results
The conversions in the four bases appear instantly.
Base conversion table
Here are the numbers 0 to 16 written in the four most common bases:
| Decimal (10) | Binary (2) | Octal (8) | Hexadecimal (16) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
Notice that hexadecimal uses the letters A to F to represent 10 to 15.
Conversion methods
Decimal to binary
Repeatedly divide the number by 2, note each remainder (0 or 1), then read the remainders from last to first.
Binary to decimal
Add up the powers of 2 for the bits set to 1. Example: 1101 = 8 + 4 + 0 + 1 = 13.
What are the different bases used for?
- Binary: native language of processors and memory.
- Octal: Unix file permissions (chmod), sometimes in electronics.
- Hexadecimal: web colors, memory addresses, debugging, encoding.
Frequently asked questions
What is a number base?
The base is the number of distinct digits used to write numbers. Base 10 (decimal) uses ten (0–9), base 2 (binary) two (0 and 1), base 16 (hexadecimal) sixteen (0–9 then A–F). The same number is written differently depending on the base.
How do I convert a decimal number to binary?
Repeatedly divide the number by 2, noting the remainders, then read the remainders from bottom to top. Example: 13 → 13÷2=6 r1, 6÷2=3 r0, 3÷2=1 r1, 1÷2=0 r1 → 1101.
How do I read a hexadecimal number?
Each digit represents a power of 16, and the letters A to F stand for 10 to 15. Example: 1F = 1×16 + 15 = 31 in decimal.
Why do developers use hexadecimal?
Because it is compact: one byte (8 bits) is written with exactly two hex digits. You see it in CSS colors (#FF8800), memory addresses and encoding values.
What is octal used for?
Base 8 is notably used for file permissions on Unix/Linux (e.g. chmod 755), where each digit encodes read/write/execute rights.
Is my data sent online?
No. The conversion runs locally in your browser; no number is sent to a server.