Decimal to Binary Converter
Convert decimal to binary with 8-bit grouping, plus hex and octal output
Decimal → Binary
Binary (8-bit groups)
Hexadecimal
Octal
8-bit reference table ▸
| Decimal | 8-bit Binary | Hex | Octal |
|---|---|---|---|
| 0 | 00000000 | 00 | 0 |
| 1 | 00000001 | 01 | 1 |
| 2 | 00000010 | 02 | 2 |
| 4 | 00000100 | 04 | 4 |
| 8 | 00001000 | 08 | 10 |
| 16 | 00010000 | 10 | 20 |
| 32 | 00100000 | 20 | 40 |
| 64 | 01000000 | 40 | 100 |
| 128 | 10000000 | 80 | 200 |
| 255 | 11111111 | FF | 377 |
Converting decimal numbers to binary is a core skill in systems programming, network engineering, and low-level debugging. Whether you’re checking a bitmask, understanding an IP subnet, or working with hardware registers, you need binary. This converter turns any decimal integer into binary with 8-bit grouping for readability — plus hex and octal as bonus outputs.
How Decimal to Binary Conversion Works
The algorithm: repeatedly divide the number by 2, record the remainder (0 or 1), then read the remainders in reverse.
Example: 202 → binary
| Division | Quotient | Remainder |
|---|---|---|
| 202 ÷ 2 | 101 | 0 |
| 101 ÷ 2 | 50 | 1 |
| 50 ÷ 2 | 25 | 0 |
| 25 ÷ 2 | 12 | 1 |
| 12 ÷ 2 | 6 | 0 |
| 6 ÷ 2 | 3 | 0 |
| 3 ÷ 2 | 1 | 1 |
| 1 ÷ 2 | 0 | 1 |
Reading remainders bottom to top: 11001010 = 202.
8-Bit Groups: Why They Matter
Raw binary strings become hard to read at length. Grouping into 8-bit blocks (bytes) aligns with how computers actually store data:
Without grouping: 1100101011110000
With 8-bit groups: 11001010 11110000
Each 8-bit group corresponds directly to one byte. This lets you mentally process multi-byte values more easily and spot patterns like repeated bytes or specific nibbles.
The 4-bit grouping option is useful when working with hex, since each hex digit = 4 bits:
4-bit groups: 1100 1010 → CC AA → wait, no: 1100=0xC, 1010=0xA → 0xCA
Powers of 2 Reference
Understanding powers of 2 lets you estimate binary conversions at a glance.
| Power | Decimal | Hex | Significance |
|---|---|---|---|
| 2⁰ | 1 | 0x01 | Bit 0 (LSB) |
| 2¹ | 2 | 0x02 | Bit 1 |
| 2³ | 8 | 0x08 | Nibble boundary |
| 2⁷ | 128 | 0x80 | Sign bit (8-bit) |
| 2⁸ | 256 | 0x100 | 9-bit range start |
| 2¹⁰ | 1,024 | 0x400 | 1 KiB |
| 2¹⁵ | 32,768 | 0x8000 | Sign bit (16-bit) |
| 2¹⁶ | 65,536 | 0x10000 | 16-bit max + 1 |
| 2³¹ | 2,147,483,648 | 0x80000000 | Sign bit (32-bit) |
Practical Applications
IP Subnet Masks
Subnet masks are fundamentally binary: /24 means the first 24 bits are 1, the rest are 0.
255.255.255.0=11111111.11111111.11111111.00000000/16=255.255.0.0=11111111.11111111.00000000.00000000
The binary view reveals why subnetting works the way it does.
Bitmask Operations in Code
Flags are often packed into a single integer for efficiency:
const READ = 0b0001; // 1
const WRITE = 0b0010; // 2
const EXECUTE = 0b0100; // 4
let perms = READ | WRITE; // 3 = 0b0011
let canRead = perms & READ; // 1 (truthy)
let canExec = perms & EXECUTE; // 0 (falsy)
Color Channel Arithmetic
RGB colors: each channel is an 8-bit (0–255) decimal value. 128 = 0b10000000 — exactly half brightness.
Signed vs. Unsigned
In 8-bit signed arithmetic, 128 decimal overflows (the MSB is the sign bit). Binary makes this visible: 10000000 is -128 in two’s complement. This tool shows unsigned values; the bit pattern is the same, but interpretation differs.
The Bit Count Display
The tool shows how many bits the result uses and how many bytes it requires. A value of 200 uses 8 bits (1 byte); a value of 300 uses 9 bits (2 bytes minimum).
Privacy
All conversions run entirely in your browser. No server involved, no data stored.