How to use it
- Type a number in any box: decimal, hexadecimal, binary or octal.
- The other three boxes update as you type.
- Hex values may start with 0x; spaces and underscores are ignored.
- Copy the value you need.
How to convert decimal to hex by hand
Divide the decimal number by 16 and keep the remainder. Divide the result by 16 again, and repeat until the result is 0. Write the remainders as hex digits (10 = A, 11 = B, 12 = C, 13 = D, 14 = E, 15 = F) and read them from the last one to the first.
| Step | Division | Result | Remainder | Hex digit |
|---|---|---|---|---|
| 1 | 2024 ÷ 16 | 126 | 8 | 8 |
| 2 | 126 ÷ 16 | 7 | 14 | E |
| 3 | 7 ÷ 16 | 0 | 7 | 7 |
Reading the remainders from the bottom up gives 7E8, so 2024 in hex is 7E8. Check it the other way: 7 × 256 + 14 × 16 + 8 = 2024.
How to convert hex to decimal
Multiply each hex digit by a power of 16, starting with 16⁰ = 1 on the right, then 16¹ = 16, 16² = 256, 16³ = 4,096, and add the results. For 1A3: 1 × 256 + 10 × 16 + 3 × 1 = 419.
Decimal, hex, binary and octal side by side
| Decimal | Hex | Binary | Octal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 9 | 9 | 1001 | 11 |
| 10 | A | 1010 | 12 |
| 15 | F | 1111 | 17 |
| 16 | 10 | 10000 | 20 |
| 100 | 64 | 1100100 | 144 |
| 255 | FF | 11111111 | 377 |
| 256 | 100 | 100000000 | 400 |
| 1,000 | 3E8 | 1111101000 | 1750 |
| 65,535 | FFFF | 1111111111111111 | 177777 |
Why programmers use hexadecimal
One hex digit is exactly four binary digits, so hex is a short, readable way to write binary values: a byte is always two hex digits and a 32-bit number eight. That is why hex appears in memory addresses, colour codes such as #1C1B19, error codes, MAC addresses and Unicode code points such as U+00E9.
To turn bytes of text into hex or binary, use the hex to text converter or the binary translator.
Frequently asked questions
How do I convert decimal to hexadecimal?
Type the number in the Decimal box. By hand, divide the number by 16, write down the remainder, divide the result by 16 again, and repeat until you reach 0; the remainders read from the last to the first are the hex digits (10–15 are written A–F).
How do I convert hex to decimal?
Type the hex value in the Hexadecimal box. By hand, multiply each digit by 16 to the power of its position, counting from 0 on the right, and add them up: 2F = 2 × 16 + 15 = 47.
What is 255 in hex?
255 is FF in hexadecimal, 11111111 in binary and 377 in octal. It is the largest value that fits in one byte.
What is A in hexadecimal?
A stands for 10. Hexadecimal uses A, B, C, D, E and F for the values 10 to 15, because a single digit has to represent each of the 16 values.
How do I convert binary to hex?
Type the binary number in the Binary box. By hand, split it into groups of four digits from the right and replace each group with one hex digit: 1010 1111 is AF.
Can it convert negative numbers or fractions?
No, the converter works with whole numbers of zero or more, which covers addresses, colours, IDs and byte values. It handles very large integers exactly.
Last updated · Built and checked by Moeed Hussain