Number System Conversion Reference

Binary, octal, decimal, and hex equivalents side by side

Convert any number between decimal, binary, octal, and hexadecimal, with a full reference table of values 0 to 255 in all four bases. Fast, accurate, and fully private. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How does base conversion actually work?

Every number is the sum of its digits times powers of the base. To convert to another base you repeatedly divide by the new base and read the remainders in reverse. The reference table below shows this for 0 to 255.

Convert between every common number base

Computers store everything as binary, but programmers read and write numbers in several bases depending on context: decimal for everyday arithmetic, binary for bit-level work, octal for some file permissions and legacy protocol fields, and hexadecimal for memory addresses, colours, and byte dumps. This tool converts a value between all four bases in one step and includes a complete reference table for values 0 to 255 — one full byte.

How base conversion actually works

Any number written in base b is a weighted sum of its digits:

42 (decimal) = 4 × 10¹ + 2 × 10⁰
101010 (binary) = 1×2⁵ + 0×2⁴ + 1×2³ + 0×2² + 1×2¹ + 0×2⁰
             = 32 + 0 + 8 + 0 + 2 + 0 = 42

To convert to a new base, repeatedly divide by the target base and read the remainders in reverse:

42 ÷ 2 = 21 remainder 0
21 ÷ 2 = 10 remainder 1
10 ÷ 2 =  5 remainder 0
 5 ÷ 2 =  2 remainder 1
 2 ÷ 2 =  1 remainder 0
 1 ÷ 2 =  0 remainder 1
→ read upward: 101010

The converter applies this logic automatically and validates that every character you enter is a legal digit for the selected base — 9 is rejected in binary or octal, and G is rejected in hex.

Key relationships between the bases

The power of hex and octal comes from their clean relationship to binary:

  • One hex digit = exactly four binary digits (one nibble). This is why hex is universally used for byte dumps: two hex digits always represent one byte exactly.
  • One octal digit = exactly three binary digits. Unix file permissions use octal: chmod 755 sets rwx for owner (binary 111), r-x for group (binary 101), and r-x for others (binary 101).

These relationships make mental conversion fast once you recognise common patterns:

HexBinaryDecimalCommon meaning
0x00000000000Null byte
0x0F0000111115Lower nibble mask
0xFF11111111255Max byte value; full opacity in CSS
0x7F01111111127Max signed 8-bit integer
0x8010000000128Min signed 8-bit (two’s complement)

Using the reference table

The table below the converter lists values 0 to 255 with columns for binary (padded to 8 digits), octal (padded to 3 digits), decimal, and hexadecimal (padded to 2 digits). Read across any row to translate between bases without arithmetic. This is particularly useful when mapping ASCII codes, RGB colour channel values, or IP address octets to their binary form.

All calculations run locally in your browser — no values you enter are sent anywhere.