Free tool
Hex to Decimal Converter
Convert a hexadecimal number to decimal and see the working digit by digit. Binary and octal are shown too, for numbers of any length.
- Binary
- –
- Octal
- –
- Decimal
- –
- Hex
- –
Hexadecimal (base 16) is how programmers write bytes, memory addresses, error codes and colors compactly: two hex digits always describe exactly one byte. This converter turns a hex value into decimal and shows the sum it used, so you can check the result or learn the method. The same value also appears in binary and octal.
How to use the hex to decimal converter
- Type or paste the hex number. A
0xprefix is optional, and spaces and underscores are ignored, so0xDEAD_BEEFandDE AD BE EFboth work. - Leave Convert from set to hex. You can switch it to binary, octal or decimal at any time.
- Read the decimal result, along with the binary and octal forms of the same number.
- Check the step-by-step working under the result: each digit times its power of 16.
- Use the copy button next to any result to copy it.
How it works
Each position in a hex number is worth 16 times the position to its right. The letters A to F stand for the digit values 10 to 15. To convert, multiply every digit by 16 raised to its position (counting from 0 on the right) and add everything up:
decimal = dₙ × 16ⁿ + … + d₂ × 16² + d₁ × 16¹ + d₀ × 16⁰
| Hex digit | 0–9 | A | B | C | D | E | F |
|---|---|---|---|---|---|---|---|
| Value | 0–9 | 10 | 11 | 12 | 13 | 14 | 15 |
| Position | 16⁰ | 16¹ | 16² | 16³ | 16⁴ |
|---|---|---|---|---|---|
| Place value | 1 | 16 | 256 | 4,096 | 65,536 |
The converter does this with JavaScript’s BigInt, which stores whole numbers of any size exactly, so a 64-bit or 128-bit value converts without rounding. Fractions such as 0.8 in hex aren’t supported.
Worked examples
FF → 255
F × 16¹ + F × 16⁰ = 15 × 16 + 15 × 1 = 240 + 15 = 255. In binary that is 11111111: eight ones, one full byte.
1A3 → 419
1 × 16² + A × 16¹ + 3 × 16⁰ = 1 × 256 + 10 × 16 + 3 × 1 = 256 + 160 + 3 = 419.
0x7FFFFFFF → 2,147,483,647
7 × 16⁷ + F × (16⁶ + 16⁵ + … + 16⁰) = 7 × 268,435,456 + 15 × 17,895,697 = 1,879,048,192 + 268,435,455 = 2,147,483,647. That’s the largest signed 32-bit integer, a value you’ll see as an upper limit in many programs.
FFFFFFFFFFFFFFFF → 18,446,744,073,709,551,615
Sixteen F digits are 64 one-bits, so the result is 2⁶⁴ − 1, the largest unsigned 64-bit integer. A regular JavaScript number can’t hold this exactly; BigInt can.
Hex to decimal quick reference
| Hex | Decimal | Hex | Decimal |
|---|---|---|---|
| 0A | 10 | 80 | 128 |
| 0F | 15 | FF | 255 |
| 10 | 16 | 100 | 256 |
| 1F | 31 | 3E8 | 1,000 |
| 2F | 47 | 400 | 1,024 |
| 64 | 100 | FFFF | 65,535 |
Related guides
- Converting a binary number instead? Use the binary to decimal converter, or go the other way with decimal to binary.
- Web colors like
#FF5733are three hex bytes: the hex to RGB converter turns them into red, green and blue values. - Print numbers as hex in Java with the
%xconversion, explained in our Java printf guide.
Frequently asked questions
How do you convert hex to decimal?
Multiply each hex digit by 16 raised to its position, counting from 0 at the right, and add the results. For example, 1A3 = 1 × 256 + 10 × 16 + 3 × 1 = 419.
What is FF in decimal?
FF is 255: 15 × 16 + 15 × 1. It is the largest value that fits in one byte, which is why it shows up so often in color codes and byte dumps.
What do the letters A to F mean in hex?
They are the digits for ten to fifteen: A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. Upper and lower case mean the same thing.
What does 0x mean in front of a number?
0x marks a number as hexadecimal in JavaScript, C, Java, Python and many other languages. The converter accepts values with or without it.
Can it convert very large hex numbers?
Yes. It uses JavaScript's BigInt type, so 64-bit values such as FFFFFFFFFFFFFFFF (18,446,744,073,709,551,615) and longer convert exactly. It works with whole numbers only, not hex fractions.
Related guides

Free tool
Binary to Decimal Converter
Convert a binary number to decimal and see which powers of 2 add up to the result. Hex and octal are shown too.
Free calculator

Free tool
Decimal to Binary Converter
Convert a decimal number to binary with the repeated division by 2 shown, pad it to 8, 16, 32 or 64 bits, and see negative numbers in two's complement.
Free calculator

Free tool
Hex to RGB Color Converter
Turn a hex color code into rgb(), rgba() and hsl() values with a color preview, or enter red, green and blue to get the hex code.
Free calculator
Free Developer and PC Tools
Free formatters, decoders and converters for developers and PC users. Everything runs in your browser, and nothing you type is sent anywhere.
2 min read