Number Base Converter (Binary, Decimal, Hex)
Enter a number and choose its system to see its value in all four systems at once.
How do number systems work?
Each number system has a base showing how many different digits it uses. In daily life we use decimal (base 10); computers work in binary (base 2). Octal (base 8) and hexadecimal (base 16) are used to write binary data compactly. To convert a number, it is first reduced to its value and then written in the target base.
How to use it
- Type the number you want to convert.
- Choose which system the number is in.
- Press Run to see its value in all four systems.
Example table
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 10 | 1010 | 12 | A |
| 255 | 11111111 | 377 | FF |
| 1024 | 10000000000 | 2000 | 400 |
| 4095 | 111111111111 | 7777 | FFF |
One hex digit equals exactly four binary digits. For example F = 1111, so FF = 11111111. That is why color codes and memory addresses are written in hexadecimal.
How to convert by hand
To convert decimal to binary, keep dividing by 2 and read the remainders from bottom to top. For example 10: 10÷2=5 remainder 0, 5÷2=2 remainder 1, 2÷2=1 remainder 0, 1÷2=0 remainder 1; reading bottom to top gives 1010. For the reverse, multiply each binary digit from the right by 1, 2, 4, 8... and add: 1010 = 8+0+2+0 = 10. To get hexadecimal, split the binary number into groups of four from the right: 1111 1111 = F F.
Things to keep in mind
- If you enter a digit that does not fit the chosen system the tool warns you (for example a 2 in a binary number).
- Leading zeros in the octal and hexadecimal output are dropped.
- Only zero and positive whole numbers are converted; negative and fractional numbers need separate methods.
Why is hexadecimal so common in computing?
One hexadecimal digit corresponds to exactly 4 bits, so an 8-bit byte is always written with two hex digits. The binary number 11111111 is hard to read, while its hex form, FF, is short and clear.
You meet this in everyday places too: in the web colour code #FF0000, FF is 255, the maximum value of the red channel. File permissions on Linux, such as 755, are written in octal; each digit is the sum of the read, write and execute permissions.
Frequently asked questions
What is the binary system?
A number system that uses only the digits 0 and 1. Computers store data in binary, so it is common in programming.
Where is hexadecimal used?
In color codes (like #FF5733), memory addresses and to write binary data compactly. It uses the digits 0-9 and letters A-F; each hex digit corresponds to four binary digits.
Does it convert decimals?
No. The tool converts zero and positive whole numbers. Large numbers keep full precision.
Can I type numbers starting with 0x or 0b?
Yes. The prefix matching your chosen system (0x hex, 0b binary, 0o octal) is ignored, and spaces between digits are removed.