Hex to Decimal Converter - Free Online Base Converter

Convert hex to decimal (and back) instantly in your browser. Free, no sign-up, supports 0x prefix. Also shows binary and octal. Try it now.

Tool options

Input base

Converts as you type. Prefixes 0b / 0o / 0x are accepted.
Binary (2)11111111
Octal (8)377
Decimal (10)255
Hex (16)FF

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

  1. Type or paste your hex value into the Hex field — for example, 1F4 or 0x1F4.
  2. The Decimal field updates immediately as you type. No need to press Enter or click Convert.
  3. Need to go the other way? Type a decimal number and the hex output fills in automatically.
  4. 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?

BasePrefixValue
Hexadecimal (base 16)0xFF
Decimal (base 10)none255
Binary (base 2)0b11111111
Octal (base 8)0o377

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.

BaseNameWritten asLanguage prefix example
10Decimal255255
16HexadecimalFF0xFF
2Binary111111110b11111111
8Octal3770o377

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 #1A2B3C looks 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, 0x41 is 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.

Frequently asked questions

Is this hex to decimal converter free?+
Yes, completely free. No account, no sign-up, no usage limits — just open the page and start converting.
Does the tool accept the 0x prefix?+
Yes. You can type 0xFF or just FF — the tool strips the prefix automatically and converts either way.
Can I convert decimal back to hex?+
Absolutely. Just type your decimal number into the Decimal field and the hex equivalent appears immediately. The conversion works in both directions.
Is my data uploaded or stored anywhere?+
Nothing leaves your browser. All the conversion logic runs locally in JavaScript, so your values are never sent to a server and are not stored anywhere.
What is the largest hex value this tool can handle?+
The tool uses JavaScript's built-in number handling, which safely covers integers up to 2^53 − 1 (about 9 quadrillion). That is far beyond anything you would encounter in typical hex values like colour codes or memory addresses. For cryptographic keys or very large hex strings, a BigInt-aware library is more appropriate.
How do I convert hex to decimal in Python?+
Use int('FF', 16) — the second argument tells Python the input is base 16. It returns the integer 255. You can also pass '0xFF' with the prefix and it still works.
How do I convert hex to decimal in JavaScript?+
Use parseInt('FF', 16). The second argument (16) is the radix. It returns the number 255. To go the other way, use (255).toString(16), which gives you 'ff'.
What is the difference between hex and decimal?+
Decimal counts in base 10 using digits 0–9. Hexadecimal (often called hex) counts in base 16 using 0–9 plus A–F, where A means 10 and F means 15. Hex is popular in computing because one hex digit maps neatly to exactly four binary digits (bits), making it a compact way to represent raw data.