Convert Hex to Decimal
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.
How to Use Convert Hex to Decimal
- Paste your hex value. The
0x/0Xprefix is optional; spaces, underscores, and newlines are stripped automatically. Case-insensitive. - Choose interpretation: Unsigned treats the hex as a non-negative magnitude; Signed applies two's complement based on the selected bit width.
- 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). - Enable Batch mode if each line is a separate hex value. Bad lines flag in the error list; good ones still decode.
- Press Convert (or Ctrl+Enter / Cmd+Enter). Auto-convert fires 200 ms after each keystroke.
- 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.
- 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.
Related Tools
Convert Decimal to Hex →
Convert decimal numbers to hexadecimal instantly, individually or in bulk. Free, client-side converter with…
Add Hex Numbers →
Add Hex Numbers instantly. Free, offline, client-side tool that outputs results in both hex…
ASCII to Hex Converter →
Convert ASCII to Hex - code points or UTF-8 bytes, space/comma/0x-prefixed, uppercase or lowercase.…
Base32 to Hex Converter →
Base32 to Hex Converter - pick separator, case, and prefix. Free, client-side, instant, offline,…
Base58 to Hex Converter →
Decode Bitcoin, Ripple, or Flickr Base58 strings to hex - with separator, case, and…
Base64 to Hex Decoder →
Decode Base64 to hex bytes - URL-safe variant, separator options, uppercase toggle, UTF-8 aware.…
BCD to Hex Converter →
Convert packed BCD to hexadecimal - decimal-value or nibble mode, BigInt precision, COMP-3 sign.…
Convert Gray Code to Hex →
Decode Gray code (reflected binary) to hex, decimal, or binary. Accepts binary or hex-packed…
Convert Hex to ASCII →
Decode hexadecimal bytes to ASCII text. Auto-detect separators, handle non-printable bytes four ways, batch…
Convert Hex to BCD →
Convert hex to Binary Coded Decimal - packed, unpacked, or COMP-3 with sign nibble.…
Convert Hex to Binary →
Convert hex to binary with nibble-accurate bit widths. 5 grouping modes, 0b prefix toggle,…
Convert Hex to Gray Code →
Convert hex to Gray code (reflected binary) with BigInt precision. Handles 32+ bit values…