Home Tools Blog About

Convert Hex to Decimal

In short

Convert hex to decimal with BigInt precision. Explicit bit-width two's complement for signed values, batch mode, and a step-by-step place-value breakdown.

  • Runs in your browser
  • Nothing uploaded
  • Free, no sign-up

Convert hexadecimal to decimal with BigInt precision - no loss at 16+ digits. Choose unsigned or signed two's complement interpretation with explicit bit width (8/16/32/64/128 or Auto). Supplementary binary + octal output included.

Enter hex to convert.
🛡
100% PrivateNo server uploads, ever
InstantRuns in your browser
💧
No WatermarksClean output, always
🆓
Free ForeverNo accounts, no limits

How to Use Convert Hex to Decimal

  1. Paste your hex value. The 0x/0X prefix is optional; spaces, underscores, and newlines are stripped automatically. Case-insensitive.
  2. Choose interpretation: Unsigned treats the hex as a non-negative magnitude; Signed applies two's complement based on the selected bit width.
  3. Pick a bit width for signed mode: 8, 16, 32, 64, or 128 bits to match your CPU register or protocol field. "Auto" uses hex digit count × 4 - intuitive for variable-width hex like FFFF (16-bit).
  4. Enable Batch mode if each line is a separate hex value. Bad lines flag in the error list; good ones still decode.
  5. Press Convert (or Ctrl+Enter / Cmd+Enter). Auto-convert fires 200 ms after each keystroke.
  6. Read the breakdown: each row shows hex → decimal, plus supplementary binary and octal, plus bit width. In signed mode, both unsigned and signed values appear side by side.
  7. Copy or Download. Copy places the primary decimal output on your clipboard; Download saves as .txt.

Frequently Asked Questions

How is hex converted to decimal?

Each hex digit is a position in base 16. The rightmost digit contributes its value × 160, the next × 161, and so on. 0xFF = 15×161 + 15×160 = 240 + 15 = 255. This tool uses JavaScript’s native BigInt, so the math is exact for any input length.

What’s the difference between signed and unsigned?

Unsigned treats the hex as a non-negative magnitude – 0xFF is just 255. Signed (two’s complement) interprets the high bit as a sign bit. For 8-bit signed, 0xFF is −1 (because all bits set means “all magnitude subtracted”), 0x80 is −128, 0x7F is +127. This matches how CPUs encode negative integers.

Why do I need to pick a bit width for signed mode?

Because the sign-bit position depends on width. 0xFF at 8-bit is −1, but 0x00FF at 16-bit is +255 – same numeric value, different interpretation. Without an explicit width, the tool has to guess from digit count, which can confuse users. “Auto” mode uses nibble-count × 4 (so FF → 8-bit, FFFF → 16-bit); switch to a fixed width when you know your target’s register size.

Does this handle values larger than 2^53?

Yes. JavaScript’s native BigInt has no upper bound – 256-bit or 1,024-bit hex values produce their exact decimal representation. Regular Number arithmetic would silently round off anything past 9,007,199,254,740,991 (253 − 1), which you’d hit with any 14+ digit hex. BigInt is the only safe choice for this.

What input formats are accepted?

Bare digits (FF), C-style prefix (0xFF or 0XFF), with spaces (FF 00), with underscores (DE_AD_BE_EF), across multiple lines, or any combination. Case-insensitive – aBc and ABC and Abc all decode identically.

What happens if my hex exceeds the chosen bit width?

You get an error naming the overflow. For example, setting width to 8-bit and entering 0x1FF (9 bits needed) will fail with “Value 0x1FF (511) exceeds chosen 8-bit width (max 255).” Auto mode doesn’t have this restriction because it derives the width from your input.

What do the supplementary binary and octal displays show?

Each successfully converted value shows its bit pattern (binary, with leading zeros preserved to fill the chosen bit width) and its octal form. This is useful when the same value is needed in multiple bases – you can grab all three from one conversion, no round-trip through separate tools.

What’s batch mode for?

When each line of input is a separate hex value – for example a column of pointer addresses from a debugger, or the contents of a memory dump. Batch mode processes each line independently, so a typo on one line doesn’t break the others. Invalid lines appear in the error list below the breakdown.

Is my data uploaded anywhere?

No. All arithmetic runs in your browser’s JavaScript engine – no network requests fire during conversion, no cookies are set, no analytics are sent. You can verify with your browser’s Network tab. The tool keeps working after you disconnect from the internet.

Can I round-trip decimal back to hex?

Yes – the conversion is lossless in both directions. Use our “decimal to hex” converter (or Python’s hex(), or JavaScript’s .toString(16)). For signed values, make sure the decimal-to-hex tool you pick knows which bit width to encode at, otherwise small negative numbers come back ambiguous.

Keep going

Related Tools

All Hex tools →
Share

Embed this tool

Add this free tool to your website. Copy and paste the code: