Binary, Decimal and Hexadecimal

7 min read · Updated September 26, 2026 · by the SolveCalcPro editorial team

Binary, Decimal and Hexadecimal – feature image

A number system is a way of writing numbers using a fixed set of digits. We use base 10 because we have ten fingers. Computers use base 2 because a circuit is either on or off. Programmers also use base 16 because it is a compact way to write binary.

Place value in any base

In decimal, 345 means 3×100 + 4×10 + 5×1. In binary the places are powers of 2: 1, 2, 4, 8, 16… So 101101₂ = 32 + 8 + 4 + 1 = 45. In hexadecimal the places are powers of 16 and the digits go 0–9 then A–F (A = 10 … F = 15).

Converting decimal to binary

Divide by 2 repeatedly and read the remainders from the bottom up. 45 ÷ 2 = 22 r1; 22 ÷ 2 = 11 r0; 11 ÷ 2 = 5 r1; 5 ÷ 2 = 2 r1; 2 ÷ 2 = 1 r0; 1 ÷ 2 = 0 r1. Reading upward: 101101. Check any conversion with the base converter.

Hex as shorthand for binary

Each hex digit is exactly four bits. 1111 0000 in binary is F0 in hex, which is 240 in decimal. That is why colours (#FF8800), MAC addresses and memory addresses are written in hex.

Reference table

DecimalBinaryOctalHex
81000108
15111117F
64100000010040
25511111111377FF

Why bytes hold 0 to 255

A byte is 8 bits, giving 2⁸ = 256 combinations, from 00000000 to 11111111. That is the origin of RGB colour values from 0 to 255 and of the number 255 in IP addresses.

Practice questions

Test yourself, then tap to check. Answers are calculated by the tools linked below.

  1. Convert 2026 (decimal) to binary and hex.
    Show answer

    Decimal (base 10): 2026

  2. Calculate 7^4.
    Show answer

    7^4: 2,401

  3. Write 2049 in Roman numerals.
    Show answer

    2049 in Roman numerals: MMXLIX

Frequently asked questions

Why do computers use binary?

Two states are easy and reliable to build in hardware: voltage high or low, switch on or off.

What does 0x mean before a number?

It marks a hexadecimal number in many programming languages, such as 0xFF = 255.

How do I convert hex to decimal?

Multiply each digit by its power of 16 and add. 3E8 = 3×256 + 14×16 + 8 = 1,000.

What is octal used for?

Mostly Unix file permissions like 755, because each octal digit is three bits.

Try it yourself

Keep learning

Written and reviewed by the SolveCalcPro editorial team. Spot a mistake? Tell us. See our editorial policy.