Number Base Converter
Convert numbers between decimal, binary, hexadecimal, and octal instantly.
Did this tool work for you?
How to use this calculator
- 1
Enter a decimal (base 10) number in the input field.
- 2
The calculator instantly shows the equivalent in binary, hexadecimal, and octal.
- 3
For hexadecimal output, letters A–F represent values 10–15.
Frequently asked questions
What is binary?
Binary is base 2, which uses only the digits 0 and 1. Computers store data this way because circuits have two states. The decimal number 10 is 1010 in binary, and 255 is 11111111.
What is hexadecimal used for?
Hexadecimal is base 16, with digits 0 to 9 and letters A to F for 10 to 15. Each hex digit stands for exactly four bits, so a byte is two hex digits. 255 is FF, and web colours such as #FF5733 are three hex bytes.
How do I change decimal to binary by hand?
Divide by 2 repeatedly and note the remainders, then read them bottom to top. For 13: 13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1, giving 1101. The tool does this and also shows hex and octal.
What is octal used for?
Octal is base 8, with digits 0 to 7, and each digit equals three bits. It survives in Unix file permissions: decimal 493 is octal 755, i.e. 111 101 101 in binary, meaning read-write-execute for the owner and read-execute for the group and others.
How does the tool treat negative numbers and decimals?
It keeps the minus sign and drops any fractional part, truncating toward zero. -10 gives -1010 in binary, -A in hex and -12 in octal, and 3.7 is treated as 3. That is a signed representation and not two’s complement. For fixed-width forms, such as -1 in 8 bits, you need to work out the bit pattern yourself.
Can I type a hex or binary number to get decimal?
No. The input is a decimal number only, and the tool shows the other bases as results. To go from hex to decimal, multiply each digit by a power of 16 and add: FF is 15 × 16 + 15 = 255.
What is the largest number it accepts?
9,007,199,254,740,991 (2^53 − 1). Beyond that, the browser’s numbers cannot hold every whole value exactly, so the tool shows an out-of-range message instead of a wrong answer.
Number bases: decimal, binary, hexadecimal and octal
One number, four ways to write it
The same quantity can be written in base 10, base 2, base 16 or base 8, and only the notation changes. Enter a whole number in decimal and the tool prints it in binary, hexadecimal and octal. Because 16 is 2^4, one hex digit covers four bits, and because 8 is 2^3, one octal digit covers three. That is why programmers prefer them to long strings of 0s and 1s. The tool takes decimal input because that is the notation people type, then derives the other three bases for you from the same whole number.
Reference values taken from the converter
The rows show powers of two and common limits, copied from the tool’s output.
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 10 | 1010 | A | 12 |
| 16 | 10000 | 10 | 20 |
| 64 | 1000000 | 40 | 100 |
| 255 | 11111111 | FF | 377 |
| 256 | 100000000 | 100 | 400 |
| 1,024 | 10000000000 | 400 | 2000 |
| 4,095 | 111111111111 | FFF | 7777 |
| 65,535 | 1111111111111111 | FFFF | 177777 |
Worked examples: a byte, a year and a permission
255 is 11111111 in binary, FF in hex and 377 in octal, the largest value of an unsigned byte. 2026 gives 11111101010, 7EA and 3752. The decimal value 493 comes out as 111101101, 1ED and 755, and 755 is the familiar Unix permission code. Notice that 65,535 is FFFF, sixteen 1s, the largest 16-bit unsigned value. For a quick mental check, 1024 is 2^10 and shows as a 1 followed by ten 0s in binary, 400 in hex and 2000 in octal. 4,095 is 2^12 minus 1, hence twelve 1s, FFF and 7777.
Signs, fractions and limits
The tool keeps a minus sign, so -10 shows as -1010, -A and -12. This is a signed representation, not the two’s complement form used in hardware. A fractional input is truncated toward zero, so 3.7 and -3.7 are processed as 3 and -3. Whole numbers up to 9,007,199,254,740,991 are supported; larger ones return an out-of-range message. Programmers working with unsigned bytes can read the output directly: an unsigned 8-bit value never exceeds 255, so a longer result signals a bigger field is needed.
Using the result
Hex pairs map to bytes, so FF is one byte and FFFF is two. Octal digits map to permission groups. If you need the reverse direction, from hex or binary to decimal, add up digit times power of the base by hand, as the tool only accepts decimal input.
Learn more from an authoritative source:
NISTForce Converter
Convert between newtons, kilonewtons, pound-force, kilogram-force, dynes, and more.
Angle Converter
Convert between degrees, radians, gradians, arcminutes, arcseconds, and revolutions.
Fuel Consumption Converter
Convert between MPG (US), MPG (UK), L/100km, and km/L fuel efficiency units.
Frequency Converter
Convert between hertz, kilohertz, megahertz, gigahertz, and RPM.
Image Resolution Converter
Convert between DPI, PPI, dots per cm, and dots per mm for print and screen.
Data Transfer Speed Converter
Convert between Mbps, MBps, Gbps, kbps, and other network speed units.
Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →