// Math tools

Number Base Converter

Convert between decimal, binary, and hexadecimal — with a full step-by-step breakdown showing exactly how the answer was reached.

How does decimal → binary work?

Keep dividing the number by 2. Each time, write down the remainder (0 or 1). When you reach 0, stop. Read the remainders from bottom to top — that's your binary number. Each remainder is one bit.

Decimal input
// Binary result
// How we got there — step by step

How does decimal → hex work?

Keep dividing the number by 16. Write down each remainder — if it's 10–15, use the letters A–F instead (10=A, 11=B, 12=C, 13=D, 14=E, 15=F). When you reach 0, stop. Read the remainders from bottom to top.

Decimal input
// Hex result
// How we got there — step by step

How does binary → decimal work?

Each bit position has a place value that doubles from right to left: 1, 2, 4, 8, 16, 32, 64, 128… Wherever there's a 1 in the binary number, add that position's value. Skip positions with a 0. Add them all up — that's your decimal answer.

Binary input (1s and 0s only)
// Decimal result
// How we got there — step by step

How does binary → hex work?

Split the binary number into groups of 4 bits (starting from the right — pad with zeros on the left if needed). Each group of 4 bits converts directly to one hex digit: 0000=0, 0001=1 … 1001=9, 1010=A, 1011=B, 1100=C, 1101=D, 1110=E, 1111=F.

Binary input (1s and 0s only)
// Hex result
// How we got there — step by step

How does hex → binary work?

Each hex digit converts to exactly 4 binary bits (a "nibble"). Simply replace every hex digit with its 4-bit binary equivalent. The groups stay in the same order — just translate each one individually then join them together.

Hex input (0–9 and A–F)
// Binary result
// How we got there — step by step

How does hex → decimal work?

Each hex digit has a place value that is a power of 16, multiplying by 16 from right to left: 1, 16, 256, 4096… Multiply each digit's decimal value (A=10, B=11, C=12, D=13, E=14, F=15) by its place value, then add all the results together.

Hex input (0–9 and A–F)
// Decimal result
// How we got there — step by step