Decimal Converter

Decimal (base-10) is the number system we use in everyday life. But computers store data in binary, memory addresses are often shown in hex, and Unix systems use octal for permissions. The repeated-division algorithm converts any decimal integer to any other base in a predictable, easy-to-follow sequence of steps.

decimal (Base 10)

Notes

The Repeated Division Algorithm

To convert a decimal number N to base B, divide N by B repeatedly. Each division gives a quotient (carry it forward) and a remainder (save it as one digit of the answer). When the quotient reaches 0, you are done. Read the collected remainders from bottom (last) to top (first) — that sequence is the result in base B.

  1. Divide N by the target base B. Record the remainder.
  2. Replace N with the quotient. Divide again. Record the remainder.
  3. Repeat until the quotient is 0.
  4. For base 16: if a remainder is 10–15, write it as A–F respectively.
  5. The final answer is all remainders read from last to first (most significant first).

Converting Decimal to Binary — Example: 89

Dividend÷ 2QuotientRemainder (bit)
89÷ 2441
44÷ 2220
22÷ 2110
11÷ 251
5÷ 221
2÷ 210
1÷ 201
Read remainders bottom to top: 1, 0, 1, 1, 0, 0, 1 → (89)₁₀ = (1011001)₂. Verify: 64+16+8+1 = 89 ✓

Converting Decimal to Octal — Example: 255

Dividend÷ 8QuotientRemainder (digit)
255÷ 8317
31÷ 837
3÷ 803
Read bottom to top: 3, 7, 7 → (255)₁₀ = (377)₈. Verify: 3×64 + 7×8 + 7 = 192+56+7 = 255 ✓

Converting Decimal to Hexadecimal — Example: 3454

Dividend÷ 16QuotientRemainder (digit)
3454÷ 1621514 → E
215÷ 16137
13÷ 16013 → D
Read bottom to top: D, 7, E → (3454)₁₀ = (D7E)₁₆. Verify: 13×256 + 7×16 + 14 = 3328+112+14 = 3454 ✓

Why Remainders Are Read in Reverse

The first remainder you get is the least significant digit (lowest power of the base). The last remainder is the most significant digit. Reading bottom-to-top reverses the order so the most significant digit appears first, matching standard positional notation.

Frequently Asked Questions

Does this work for any decimal integer?

Yes — the repeated-division algorithm works for any positive integer. For zero, the result is 0 in every base. Negative numbers require a sign or a representation like two's complement (not covered here).

How do I convert a decimal fraction like 0.75 to binary?

For fractional parts, use repeated multiplication instead of division: multiply by 2, save the integer part (0 or 1) as the next binary digit, and repeat with the fractional remainder. For 0.75: 0.75×2=1.5 (digit 1), 0.5×2=1.0 (digit 1) → 0.75₁₀ = 0.11₂.

Is there a shortcut from decimal to hexadecimal?

For small numbers (0–255), you can convert to binary first (8 bits) and then split into two 4-bit groups, each mapping to one hex digit. For example, 89₁₀ = 01011001₂ → 0101 | 1001 → 5 | 9 → 59₁₆. The repeated-division method is more general.

How does the calculator handle hex remainders 10–15?

When dividing by 16, remainders 10 through 15 are written as hex letters: 10=A, 11=B, 12=C, 13=D, 14=E, 15=F. The step-by-step table shows both the numeric value and the letter so you can follow along.