Hex to Decimal Converter_

Convert hexadecimal to decimal instantly, with the working shown: type a value — 0x prefix or bare, either case, separators welcome — and get the decimal result, the binary equivalent, and the positional math that produced it. Exact at any size, because the arithmetic is big-integer, not floating point.

When the hex is really a raw byte or register field, flip on Signed to read it as 8/16/32/64-bit two's complement — the interpretation where FF means −1, which naive converters silently get wrong.

toolkit.codes/hex-to-decimal
Decimal → hex
Decimal_Output
UTF-8
Ready
100% LOCAL
Input
A hexadecimal value as you found it — 0x-prefixed or bare, upper case, lower case or mixed, with spaces or underscores between the bytes.
Output
The decimal number it stands for, with the arithmetic laid out digit by digit, the binary alongside, and the signed reading when the value is a fixed-width field.
Processing
Converted in this tab with BigInt arithmetic end to end, so a 40-digit address is exact rather than rounded.
Limits
No ceiling on the value. A character that is not a hex digit is named with its position rather than quietly ignored, and a fractional hex value is refused instead of truncated.
Where you met it
A colour like #1E90FF, an error code, a memory address, a byte in a hex dump, a permission mask. This page is for hex somebody else wrote — producing hex from a number you have is the decimal to hex tool.

A hex to decimal converter that shows the math

How the conversion from hex to decimal works

Hexadecimal is base 16: digits 0–9 keep their values and A–F stand for 10–15, with each position worth sixteen times the one to its right. How to convert hex to decimal by hand: multiply every digit by 16 raised to its position (rightmost is 16⁰) and add the terms. For 0x1A3F: 1×16³ = 4096, A(10)×16² = 2560, 3×16¹ = 48, F(15)×16⁰ = 15 — sum 6,719. That is exactly the working this hex to decimal convertor prints under the result, so you can follow the conversion instead of trusting a black box.

Why exactness needs integer math

Plenty of hex to decimal calculator pages do their math in floating point, which holds only 53 bits of precision. Convert 0x20000000000001 there and you get 9,007,199,254,740,992 — off by one, silently, because the true value 9,007,199,254,740,993 is 2⁵³+1 and doesn't fit a double. This page computes with arbitrary-precision integers end to end; that exact landmark is asserted in its test suite. If you convert file offsets, database IDs, or 64-bit addresses, this is the difference between an answer and an approximation.

Signed bytes — when FF means −1

A hex dump doesn't say whether its bytes are signed. Unsigned, FF is 255; read as a signed byte in two's complement it is −1, because the top bit means negative and the value wraps below zero. Sensor registers, temperature fields, audio samples, and protocol deltas are routinely signed, and reading them unsigned produces plausible-looking nonsense (a temperature of 255° instead of −1°). The Signed toggle interprets your input at 8, 16, 32, or 64 bits — Auto picks the width from the digit count — and shows the unsigned reading alongside, so both possibilities stay visible.

Hex to decimal in Excel and Python

In Excel, =HEX2DEC("1A3F") converts directly — but mind its quirk: it works on 10 hex digits (40 bits) and treats values with the top bit set as negative two's complement, so =HEX2DEC("FFFFFFFFFF") returns −1, not a trillion-scale number. In Python, int("1a3f", 16) or a literal 0x1a3f gives exact integers at any size, and int("0x1a3f", 0) auto-detects the prefix. Both mirror this page — Python matches the unsigned default; Excel's behavior is the Signed toggle at 40 bits.

Paste the hex you were handed and read it back

  1. 01Type or paste the hex value. This hex to decimal translator accepts the 0x prefix or none, uppercase or lowercase, and spaces or underscores between digits — the translation updates on every keystroke, like a calculator with no equals key.
  2. 02Read the decimal result, the binary equivalent underneath, and — for values up to 10 digits — the positional working that shows how the conversion was calculated.
  3. 03If the value is a raw byte, register, or sensor field, switch Signed on and choose the field width — or leave it on Auto, which infers one from the digit count. The unsigned reading stays visible beside the result.
  4. 04Copy_Result puts the decimal on your clipboard. For the reverse direction, the Decimal → hex link at the top right jumps to the paired page — the next stop for most converter hex to decimal sessions.

Four hex values off real screens

Register value from a datasheet

The datasheet says write 0x3E8 to the delay register. What is that in milliseconds? The working shows the math, not just the answer.

Input
0x3E8
Output
1000
3 × 16² = 768 · E(14) × 16¹ = 224 · 8 × 16⁰ = 8

How big is that memory address?

A crash log prints an address. Converting shows where in the process space it falls — and big-integer math keeps all 48 bits exact.

Input
0x7FFEE4C0A9B0
Output
140732776344496

A sensor reading that looks insane

The I²C temperature register reads 0xFFF6. Unsigned that's 65,526 — obviously wrong. Signed 16-bit: −10. The sensor is fine; the interpretation wasn't.

Input (Signed, 16-bit)
0xFFF6
Output
-10  ·  unsigned: 65,526

Splitting an ARGB color

0x80FF0000 as one number is 2,164,195,328 — but a color is four bytes: 80 alpha, FF red, 00 green, 00 blue. Convert channels separately; the whole-number reading answers the wrong question.

Input (one channel)
0x80
Output
128 (50% alpha)

The sixteen hex digits

HexDecimalBinary
0 – 90 – 90000 – 1001
A101010
B111011
C121100
D131101
E141110
F151111

One hex digit is exactly four bits, which is why hex is the notation of choice for bytes: two digits per byte, no ambiguity. Case never matters — 0xff and 0xFF are the same number.

Landmark values worth recognizing

HexDecimalWhat it signifies
0xFF255Largest byte — or −1 signed
0x100256One past a byte; the classic overflow boundary
0xFFFF65,535Largest 16-bit value; highest TCP/UDP port
0x7FFFFFFF2,147,483,647INT32_MAX — 32-bit signed overflow (the 2038 limit)
0xFFFFFFFF4,294,967,295All 32 bits set: UINT32_MAX, or signed −1
0x200000000000019,007,199,254,740,9932⁵³+1 — the first integer float tools get wrong

If a converter shows 9,007,199,254,740,992 for the last row, it computes in floats. This one is asserted against exactly that failure.

Reading hex off a screen without misreading it

  • Paste values exactly as logged — 0x prefixes, mixed case, and underscore or space grouping are all understood, so there’s nothing to clean up first.
  • A negative result with Signed on isn’t an error — it’s the point. Check the unsigned reading shown alongside before deciding which interpretation your data uses.
  • Use Auto width when the digit count matches the field size (2 digits = a byte, 4 = a 16-bit register); pick the width explicitly when leading zeros were dropped.
  • The working panel doubles as a teaching aid — convert with the panel visible, then reproduce the positional sums by hand for exam-style practice.
  • For 64-bit addresses and IDs, verify any other tool against the 0x20000000000001 landmark before trusting it — most float-based pages fail it.
  • Converting both directions? The Decimal → hex link keeps the paired converter one click away instead of retyping the URL.

Where a hex value means something other than you think

Signed and unsigned read the same bytes differently

0xFFF6 is 65,526 or −10 depending on a decision the bytes themselves don’t record. Registers, sensors, and file formats document their signedness — check the datasheet, then set the Signed toggle to match. A value that looks absurdly large is the classic symptom of reading signed data unsigned.

Floating-point converters lose digits silently

Doubles hold 53 bits; hex values past 0x1FFFFFFFFFFFFF get rounded with no warning. The corruption is invisible — the result is a plausible number, just not yours. Test any converter with 0x20000000000001; this page computes it exactly and asserts it in tests.

0x, \x, and # mean different things

0x1A is a numeric literal; \x1A is a byte escape inside a string; #1A3FBC is a color — three separate channel bytes. Pasting a CSS color here converts it as one six-digit number: legal arithmetic, almost never what you meant. Strip the marker and convert per channel instead.

Case carries no meaning

0xff, 0xFF, and 0xFf are identical values. If two tools disagree on inputs differing only in case, the tools disagree — not the numbers. (Hashing the text of a hex string is the one context where case matters: hashes see characters, not values.)

Excel’s HEX2DEC is secretly signed

HEX2DEC works on 40 bits and reads the top bit as a sign, so FFFFFFFFFF returns −1 rather than a 40-bit unsigned value. Past that width Excel needs arithmetic workarounds; here unsigned is simply the default with Signed off.

Input tolerance, arithmetic and readouts

Input
0x-prefixed or bare; upper, lower or mixed case; an explicit +/− sign where the value carries one; spaces and underscores as separators. Input is capped at 10,000 digits — far past any real register, address or identifier, and short enough that a mispaste cannot lock up the tab.
Arithmetic
BigInt end to end — exact at any size, asserted against the 2⁵³+1 landmark where float converters fail
Signed mode
8/16/32/64-bit two's complement with Auto width from the digit count; unsigned reading always shown alongside; out-of-range values report the bit count they need
Readouts
Decimal primary (optional thousands grouping) + binary secondary; the positional working appears at up to 10 digits and is suppressed beyond it
Errors
Invalid characters named with a caret at the exact position; fractional input rejected with an explanation rather than a truncated guess
Shared component
One converter component drives this page and the binary/decimal converter family — identical behavior, direction set by configuration
Actions
Sample, Clear, Copy_Result via the standard action buttons; reverse-direction link to the decimal-to-hex page
Network
None from tool code. A test sweep calls every function this page uses with fetch and XMLHttpRequest replaced by stubs that throw, so a stray request fails the build instead of shipping. Disconnect from the network and the page still works.

Questions about reading hexadecimal

How do I convert hex to decimal without a calculator?

Multiply each digit by 16 to the power of its position, counting from zero at the right, and add: 0x2F is 2×16 + 15 = 47. The working panel on this page prints those exact steps for any value up to 10 digits, so you can check hand math against it.

Do I need the 0x prefix?

No — 1A3F and 0x1A3F convert identically. The prefix is a programming convention that marks a literal as hex; this page accepts it, ignores it, and never requires it.

Why does my huge hex value convert wrong elsewhere?

Almost certainly floating-point math: doubles round integers past 2⁵³ (0x1FFFFFFFFFFFFF). This page uses arbitrary-precision integers, so a 64-bit address or ID converts digit-for-digit exactly.

When should I turn on Signed?

When the hex is a fixed-width field that can go negative: temperature or offset registers, audio samples, protocol deltas. If the unsigned answer looks impossibly large — 65,526 from a thermometer — the signed reading at the field’s width is usually the truth.

What about hex colors like #1A3FBC?

A color is three (or four) separate bytes, not one number — convert 1A, 3F, and BC individually for the channel values 26, 63, 188. Converting the whole string as a single number is valid arithmetic answering the wrong question.

How do I do this in Excel or Python?

Excel: =HEX2DEC("1A3F") — but it’s 40-bit and signed at the top bit, so large values come back negative. Python: int("1a3f", 16), or write 0x1a3f directly; both are exact at any size, like this page with Signed off.