Binary to Decimal Converter
Convert binary to decimal, hex, and octal — bidirectional, instant, private
Binary → Decimal / Hex / Octal
Decimal
Hexadecimal
Octal
Decimal → Binary (bidirectional)
Binary
Hexadecimal
Octal
Binary place values quick reference ▸
| Binary | Decimal | Hex | Octal |
|---|---|---|---|
| 0000 | 0 | 0 | 0 |
| 0001 | 1 | 1 | 1 |
| 0010 | 2 | 2 | 2 |
| 0100 | 4 | 4 | 4 |
| 1000 | 8 | 8 | 10 |
| 1010 | 10 | A | 12 |
| 1111 | 15 | F | 17 |
| 11111111 | 255 | FF | 377 |
Binary is the native language of computers — every piece of data ultimately boils down to sequences of 0s and 1s. But reading a string like 11001010 and mentally mapping it to decimal 202 is tedious and error-prone. This converter handles the translation instantly, in both directions, without sending your data anywhere.
What Is Binary (Base 2)?
Binary is a positional numeral system using only two digits: 0 and 1. Each digit position represents a power of 2, starting from 2⁰ (the rightmost bit) and increasing to the left.
1010 = 1×2³ + 0×2² + 1×2¹ + 0×2⁰
= 8 + 0 + 2 + 0 = 10
Eight binary digits form one byte — the basic unit of computer memory. A byte can represent 2⁸ = 256 distinct values (0–255).
How Binary to Decimal Conversion Works
To convert binary to decimal, multiply each bit by its positional power of 2 and sum the results.
Example: 11001010 → decimal
| Bit position (from right) | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Bit value | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 |
| Power of 2 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| Contribution | 128 | 64 | 0 | 0 | 8 | 0 | 2 | 0 |
Total: 128 + 64 + 8 + 2 = 202
Binary to Hex: The Fast Path
A single hex digit maps exactly to 4 binary bits (a “nibble”). This makes binary ↔ hex conversion trivial — no arithmetic needed, just a lookup table.
| Binary nibble | Hex | Decimal |
|---|---|---|
| 0000 | 0 | 0 |
| 0001 | 1 | 1 |
| 1010 | A | 10 |
| 1111 | F | 15 |
Example: 11001010 splits into 1100 (C) and 1010 (A) → 0xCA = 202.
Programmers working with raw memory, networking packets, or color values use hex precisely because it compresses binary into a readable format without losing the bit-pattern clarity.
Binary to Octal Conversion
Octal (base 8) groups binary bits in threes:
11001010 → 011 001 010 → 3 1 2 → octal 312
Octal was common in early Unix systems — Unix file permissions (chmod 755) use octal notation because each permission triplet (read/write/execute) maps to exactly 3 bits.
When You Actually Use Binary Conversion
- Bitmask operations: checking or setting specific flags in a flags integer (
status & 0b0010to test bit 1) - Network subnets: understanding which bits are the network vs. host portion of an IP address
- Color channels:
#FF8C00(dark orange) = R:255 G:140 B:0 — hex compresses the 24-bit binary representation - Embedded systems / hardware registers: status registers are often documented as bit fields
- Data encoding: understanding why base64 encodes 3 bytes into 4 characters (3 × 8 bits = 24 bits, split into 4 × 6-bit groups)
How to Read 8-Bit Patterns Quickly
Train yourself on these landmark values:
10000000= 128 (leftmost bit only)01111111= 127 (all bits except leftmost)11111111= 255 (all 8 bits set)00000001= 1 (rightmost bit only)11110000= 240,00001111= 15 (common nibble masks)
Privacy
All conversions run entirely in your browser using JavaScript’s built-in parseInt() and toString(). No data is sent to any server.