🔢

Number Base Converter

Convert between Binary, Octal, Decimal, and Hexadecimal in real-time. Edit any field to update all others.

🟦 Decimal (Base 10)
Digits: 0–9
🟪 Hexadecimal (Base 16)
Digits: 0–9, A–F
🟩 Binary (Base 2)
Digits: 0, 1
🟧 Octal (Base 8)
Digits: 0–7
Bit Visualization (8-bit / 32-bit)
Common Values Reference
${[ ['0', 'Zero'], ['1', 'One'], ['8', 'Byte range start (1 byte has 8 bits)'], ['16', '0x10'], ['32', '0x20'], ['64', '0x40'], ['128', '0x80'], ['255', '0xFF — max uint8'], ['256', '2^8'], ['1024', '1 KB'], ['65535', '0xFFFF — max uint16'], ['16777215', '0xFFFFFF — max color'], ].map(([n, desc]) => `
${n}
${desc}
`).join('')}

About Number Base Converter

Number Base Converter converts integers between the four numeral systems most commonly used in programming: decimal (base 10), hexadecimal (base 16), binary (base 2), and octal (base 8). Type in any of the four fields and the other three update instantly, with color-coded inputs to make each base immediately recognizable.

A visual bit representation lets you see exactly which bits are set at 8, 16, or 32-bit widths, and a quick-reference grid of common programming values (0xFF, max uint16, 1 KB, etc.) lets you load them with a single click. Everything runs in the browser with no network requests.

Common Use Cases

How to Use

  1. Type or paste a number into any of the four base fields (Decimal, Hexadecimal, Binary, Octal) — all other fields update immediately.
  2. Click any value in the Common Values Reference grid to load it as the starting number.
  3. Switch between 8-bit, 16-bit, and 32-bit views in the Bit Visualization panel to inspect which bits are set or clear.
  4. Click the Copy button above any field to copy that representation to your clipboard.

Frequently Asked Questions

Why do programmers use hexadecimal instead of decimal?

Each hex digit maps exactly to four binary bits (a nibble), making hex a compact and human-readable shorthand for binary data. Memory addresses, color codes, and byte values are much shorter in hex — for example, the 8-bit value 11111111 is simply FF in hex versus 255 in decimal. This tight correspondence makes hex the standard in assembly, networking, and low-level debugging.

What does 0xFF mean and why is it the maximum for a single byte?

0xFF is 255 in decimal — the largest value that fits in 8 bits where all bits are set to 1 (11111111 in binary). A byte has 8 bits, each of which can hold 0 or 1, giving 2^8 = 256 possible values (0 through 255). You see this limit constantly in programming: the maximum value for a single color channel in RGB, the uint8 type boundary, or a network subnet mask segment.

How are octal numbers used in real-world programming?

Octal (base 8) is most commonly encountered in Unix/Linux file permission bits. The permission string rwxr-xr-x maps to the octal value 755 (decimal 493), where each octal digit represents three permission bits for owner, group, and others respectively. When you run chmod 755 file.sh in a terminal, you are passing an octal number to set those exact bit patterns.

Advertisement