utilduck
Home · Developer · Number Base Converter

Number Base Converter

Enter a number and its base to see it converted to all four bases at once.

Results
Binary (Base 2)11111111
Octal (Base 8)377
Decimal (Base 10)255
Hexadecimal (Base 16)FF

About number bases

Computers use binary (0 and 1) at the hardware level. Octal (0–7) and hexadecimal (0–F) are compact shorthand often used in programming and memory addresses. A decimal number is converted to other bases by repeatedly dividing by the target base and reading remainders in reverse.

How do I convert between number bases?

To convert a decimal number to another base, divide it repeatedly by the target base and read the remainders in reverse order; to convert to decimal, multiply each digit by its place value and add the results. Example: decimal 255 is 11111111 in binary, 377 in octal, and FF in hexadecimal.

Steps to convert a decimal number to another base

  1. Divide the decimal number by the target base and record the remainder.
  2. Divide the quotient from the previous step by the base again, recording each remainder.
  3. Repeat until the quotient reaches 0.
  4. Read the remainders in reverse order (last calculated first) to get the converted number.
  5. For hexadecimal, replace remainders 10 through 15 with the letters A through F.

Number base conversion

Decimal value = Sum of (digit x base^position), reading positions right to left starting at 0
  • Base 2 (binary) uses digits 0-1 · Base 8 (octal) uses digits 0-7
  • Base 10 (decimal) uses digits 0-9 · Base 16 (hexadecimal) uses digits 0-9 and A-F

Common number base conversions

What is FF in hexadecimal converted to decimal?

Hex FF is decimal 255 (15 × 16 + 15 = 255).

What is 1010 in binary converted to decimal?

Binary 1010 is decimal 10 (1×8 + 0×4 + 1×2 + 0×1 = 10).

What is 255 in binary?

Decimal 255 is binary 11111111 (eight 1s, the maximum value of an 8-bit byte).

What is 100 in binary converted to decimal?

Binary 100 is decimal 4 (1×4 + 0×2 + 0×1 = 4).

What is 7F in hexadecimal converted to decimal?

Hex 7F is decimal 127 (7×16 + 15 = 127), the maximum value of a signed 8-bit byte.

What is 10 in decimal converted to hexadecimal?

Decimal 10 is hexadecimal A, since hex digits A-F represent 10-15.

What is 8 in decimal converted to octal?

Decimal 8 is octal 10 (one group of 8 plus zero ones).

What is 377 in octal converted to decimal?

Octal 377 is decimal 255 (3×64 + 7×8 + 7×1 = 255).

Example conversions across four bases

DecimalBinaryOctalHexadecimal
25511111111377FF
100110010014464
42101010522A
1000111110100017503E8
81000108

Frequently asked questions

Why do computers use binary instead of decimal?

Computer hardware is built from transistors that are most reliably read as two states, on or off, which map naturally to the binary digits 1 and 0. Using two states rather than ten reduces the chance of misreading a signal.

Why is hexadecimal common in programming?

Each hexadecimal digit represents exactly 4 binary bits, so a byte (8 bits) is always exactly 2 hex digits, like FF for 11111111. This makes hex a compact, human-readable shorthand for binary values, commonly seen in color codes and memory addresses.

How do I convert a binary number back to decimal?

Multiply each binary digit by 2 raised to its position, starting from 0 on the right, and add the results. For example, binary 1010 is (1x8) + (0x4) + (1x2) + (0x1) = 10 in decimal.

What characters are invalid for each base?

Binary only accepts 0 and 1; octal accepts 0 through 7; decimal accepts 0 through 9; hexadecimal accepts 0 through 9 and A through F, case-insensitive. Entering any other character shows an error for that base.

This tool converts non-negative whole numbers only; it does not handle negative numbers, fractional (non-integer) values, or bases other than 2, 8, 10, and 16.

Sources: Donald E. Knuth, The Art of Computer Programming, Vol. 2: Seminumerical Algorithms (positional numeral systems)

Privacy and safety

  • Runs in your browser — Everything you type is calculated on your own device. Your inputs are never sent to a utilduck server.
  • Encrypted connection — Pages are served over HTTPS, so nobody on the network can read what you load.
  • Not shared with third parties — Your inputs are not passed to analytics or advertising services.
  • Nothing is stored — Results are not saved to any server, and there is no account to create.

Last updated: 2026-08-17