Number System Converter
The number system converter translates any number between the four bases used in computing and mathematics — binary (base 2, used internally by computers), octal (base 8, used in file permissions), decimal (base 10, everyday numbers), and hexadecimal (base 16, used in colour codes, memory addresses, and web colours). Enter a number in any base and see all four representations simultaneously with step-by-step conversion working.
Numbers 0–20 in All Four Bases
| Decimal | Binary | Octal | Hex |
|---|
How to Use
- Type or paste your number in the input field — it can be in any base.
- Select the base of the number you entered from the Input base dropdown.
- All four conversions appear instantly — binary, octal, decimal, and hexadecimal.
- The step-by-step box shows how decimal converts to binary using repeated division by 2.
- Useful for programming: paste a hex colour code like FF or 1A to see its decimal and binary values.
Formula
To convert from decimal to any base: repeatedly divide by the target base and collect remainders, then read remainders bottom-up.
Decimal 13 to binary: 13÷2=6 r1, 6÷2=3 r0, 3÷2=1 r1, 1÷2=0 r1 → read up → 1101.
To convert from any base to decimal: multiply each digit by base^position and sum. Binary 1101 to decimal: 1×2³ + 1×2² + 0×2¹ + 1×2⁰ = 8+4+0+1 = 13.
Hexadecimal uses digits 0–9 then A=10, B=11, C=12, D=13, E=14, F=15. Hex FF = 15×16¹ + 15×16⁰ = 240+15 = 255.
FAQ
What is binary and why do computers use it?
Binary is base 2, using only 0 and 1. Computers use it because digital circuits naturally represent two states.
What is hexadecimal and where is it used?
Hexadecimal is base 16. It is common in memory addresses, machine code, debugging and web colour values.
How do you convert binary to decimal?
Multiply each binary digit by its power of 2 based on position, then add the results.
What is octal and where is it used in computing?
Octal is base 8 and is still seen in Unix-style file permissions, such as 755.
How do hex colour codes like #FF5733 work?
A six-digit hex colour stores red, green and blue channels. FF is 255 red, 57 is 87 green, and 33 is 51 blue.