Convert hex to decimal (and back) in one step
Paste any hexadecimal value into the tool above and get the decimal result instantly — no button to click, no sign-up needed. It also converts in the opposite direction, so you can go from decimal to hex just as easily.
How to use the hex to decimal converter
- Type or paste your hex value into the Hex field — for example,
1F4or0x1F4. - The Decimal field updates immediately as you type. No need to press Enter or click Convert.
- Need to go the other way? Type a decimal number and the hex output fills in automatically.
- The tool also shows the binary and octal equivalents at the same time, so you get the full picture in one place.
Worked example: converting hex FF to decimal
Say you are reading a colour code, a memory address, or an HTTP status buried in a log file and you see 0xFF. What does that mean in normal numbers?
| Base | Prefix | Value |
|---|---|---|
| Hexadecimal (base 16) | 0x | FF |
| Decimal (base 10) | none | 255 |
| Binary (base 2) | 0b | 11111111 |
| Octal (base 8) | 0o | 377 |
Type FF in the Hex field above and you will see 255 appear in Decimal instantly. That is the maximum value of a single byte — which is why you see it constantly in colour codes (#FF means full intensity) and bitmask operations.
Quick reference: one number across all four bases
The table below is a handy cheat sheet for the number 255. Each column shows the same value written in a different positional number system (base), along with the prefix that programming languages use to tell them apart.
| Base | Name | Written as | Language prefix example |
|---|---|---|---|
| 10 | Decimal | 255 | 255 |
| 16 | Hexadecimal | FF | 0xFF |
| 2 | Binary | 11111111 | 0b11111111 |
| 8 | Octal | 377 | 0o377 |
The prefixes 0x, 0b, and 0o are standard in Python, JavaScript, C, and most other languages. You can type them in the tool above — it strips the prefix automatically before converting.
How to convert hex to decimal in code
If you need to do this conversion inside a script rather than by hand, both Python and JavaScript make it a single line.
Python
# Convert hex string to decimal integer
decimal_value = int('1F4', 16)
print(decimal_value) # 500
# Or with the 0x prefix
decimal_value = int('0x1F4', 16)
print(decimal_value) # 500
# Go the other way: decimal to hex
hex_value = hex(500)
print(hex_value) # '0x1f4'JavaScript
// Hex string to decimal number
const decimal = parseInt('1F4', 16);
console.log(decimal); // 500
// Works with the 0x prefix too
const decimal2 = parseInt('0x1F4', 16);
console.log(decimal2); // 500
// Decimal back to hex string
const hexStr = (500).toString(16);
console.log(hexStr); // '1f4'The second argument to parseInt and int() is the radix — that is just the word for the base you are converting from. Use 16 for hex, 2 for binary, 8 for octal.
How the conversion actually works
Hexadecimal is a base-16 system: digits run from 0–9 and then A–F (where A = 10, B = 11, … F = 15). Each position to the left is worth 16 times more than the one to its right — the same idea as decimal, where each position is worth 10 times more.
To convert 1F4 manually: (1 × 16²) + (F × 16¹) + (4 × 16⁰) = 256 + 240 + 4 = 500. The tool does this arithmetic for every keypress, so you never have to.
The underlying algorithm follows the standard positional notation defined in Unicode and well-documented on MDN (parseInt).
When to use this tool — and when not to
Good uses
- Decoding colour codes — if you need to see what
#1A2B3Clooks like as RGB numbers, start here. (For colour work specifically, the HEX to RGB Color Converter goes one step further and gives you the R, G, B channels directly.) - Reading memory addresses in debugger output or crash logs.
- Understanding bitmasks and flags in hardware registers or network protocols.
- Checking ASCII / Unicode code points — for example,
0x41is the letter A (decimal 65). - Interpreting HTTP or TCP error codes that appear in hex format in log files.
When you probably don't need it
- Your language's
parseInt/int()already handles it — use code directly in a script instead of a manual tool. - If you are working purely with RGB colours, the dedicated HEX to RGB Color Converter is faster for that specific job.
- Large batch conversions (thousands of values) are better handled by a script loop than a manual tool.
Your data stays private
Everything runs inside your browser. The numbers you type are never sent to any server — no upload, no logging, no account needed. Close the tab and the data is gone.
Bookmark this page for the next time you hit a hex value you need to decode quickly. The tool above is ready whenever you are.