Binary, decimal and hex converter
Convert between base 2, 8, 10 and 16, with the place-value working.
45 (decimal)
- 101101₍2₎ = 1×2^5 + 0×2^4 + 1×2^3 + 1×2^2 + 0×2^1 + 1×2^0
- Decimal: 45
- Binary: 101101
- Octal: 55
- Hex: 2D
How it works
Each place in binary is worth double the place to its right: 1, 2, 4, 8, 16… To convert to decimal, add the place values where there is a 1.
Hexadecimal uses 0–9 and A–F, and each hex digit stands for exactly four bits.
Worked example
With Number = 101101:
- 101101₍2₎ = 1×2^5 + 0×2^4 + 1×2^3 + 1×2^2 + 0×2^1 + 1×2^0
- Decimal: 45
- Binary: 101101
- Octal: 55
- Hex: 2D
Answer: 45 (decimal)
Questions
- Why do computers use binary?
- A circuit is easiest to build with two states, on and off, which map to 1 and 0.
Learn the method properly
The chapter behind this tool, with animations, an experiment and an AI tutor who checks each step you write.
Open the chapter