Number Base Converter — Binary, Decimal, Hex, Octal

Convert whole numbers between binary, octal, decimal and hexadecimal instantly, with a full base reference table.

🔢

Number Base Converter

Numbers • binary · octal · decimal · hex

🔢
Enter a value to convert

How to Use the Number Base Converter

  1. Enter a value — type any number. Invalid text and symbols are blocked automatically.
  2. Select From and To units — choose the units to convert between.
  3. Read the animated result — the converted value, factor, and full reference table update instantly.
  4. Use Swap (⇄) — reverse the conversion in one click.

Why Use This Number Base Converter

🎯

Four number systems at once

Decimal, binary, octal and hexadecimal in one place, with the base-10 value shown alongside so the weight of each digit position can be checked rather than taken on trust.

Live as you type

Results are recalculated on every keystroke, with no submit step and no page reload, so a value can be adjusted until the answer looks right rather than guessed once.

🔒

100% private

Everything runs in your browser — no account, no uploads, nothing leaves your device.

Understanding the Number Base Converter

Programmers and students constantly convert between number systems: binary (base 2, used by digital hardware), octal (base 8), decimal (base 10, everyday numbers) and hexadecimal (base 16, used for colors, memory addresses and byte values). This converter handles all four directions and shows the value in every base at once.

Common examples: decimal 255 = binary 11111111 = octal 377 = hex FF. Decimal 16 = hex 10. The hex color #FFFFFF is three bytes, each 255 in decimal.

Formula & Logic

Positional number systems all work the same way: each digit is multiplied by the base raised to its position, counting from zero on the right. Only the base and the digit set change. Converting to decimal is a sum of those place values; converting from decimal is repeated division by the target base, reading the remainders in reverse. Bases that are powers of two — binary, octal, hexadecimal — convert between each other without any arithmetic at all, because each hex digit maps to exactly four bits and each octal digit to three. That property is the entire reason hexadecimal is used in computing.

Decimal value = Σ (digit × base^position)To base n: divide repeatedly by n, read remainders bottom-upHex digits: 0–9 then A=10, B=11, C=12, D=13, E=14, F=15

where:

base
the radix — 2 binary, 8 octal, 10 decimal, 16 hexadecimal
position
counted from 0 at the rightmost digit
digit set
a base-n system uses digits 0 to n−1

Assumptions: Unsigned integers. Fractional parts convert by repeated multiplication rather than division, and many decimal fractions — 0.1 among them — are non-terminating in binary, which is the root of floating-point rounding surprises.

Step-by-Step Example: 255 in Binary, Octal and Hexadecimal

Convert one decimal number into three bases, then use the power-of-two shortcut.

  • Decimal value255
  1. To hexadecimal: 255 ÷ 16 = 15 remainder 15. Both are F, so 255 = FF₁₆.
  2. To binary by division: 255 ÷ 2 = 127 r1, 127 ÷ 2 = 63 r1, and so on — eight 1s.
  3. So 255 = 11111111₂, the largest value an unsigned byte can hold.
  4. To octal: 255 ÷ 8 = 31 r7, 31 ÷ 8 = 3 r7, 3 ÷ 8 = 0 r3, giving 377₈.
  5. Now the shortcut: split 11111111 into nibbles — 1111 and 1111 — each of which is F. Hence FF.
  6. Verify by place value: (15 × 16¹) + (15 × 16⁰) = 240 + 15 = 255.

Result255 = FF₁₆ = 11111111₂ = 377₈

This is why colour codes look like #FF0000: each pair of hex digits is one byte, 0 to 255, for red, green and blue. Two hex characters express a full byte compactly, which no other convenient base does.

Number Base Converter FAQ

Repeatedly divide by 2 and record the remainders bottom-to-top, or just type the decimal number above and select "Binary" as the target. Example: 13 = 1101 in binary.
FF in hex equals 255 in decimal (15×16 + 15). One hex digit represents 4 bits, so two hex digits = one byte = 0–255.
Conversions are exact up to 2⁵³ (about 9.0 quadrillion), the safe-integer limit for precise calculation in the browser. Larger inputs are rejected to avoid rounding errors.

Related Converters

✔ Written & reviewed by Dr Sam — 20+ yrs in management & research leadership📅 Last updated September 2026📚 Sources: NIST & BIPM SI unit definitions📑 How we build & check these