Turn a hex number into decimal and see the place value working for every digit, with 0x prefixes stripped and the answer shown in binary and octal too.
Your files are processed in your browser, on your own device. Nothing is uploaded to a server.
This hex to decimal converter turns a hexadecimal number into its decimal value and shows the place value working under the answer. Each hex digit is multiplied by its power of sixteen and the results are added together, so you can check every digit of a memory address, a color value or a homework answer.
Type the hex, read the decimal, then check the working.
Hex is decimal’s positional idea with sixteen digits instead of ten. The digits run 0 to 9, then A to F carry the values 10 to 15, and the places, reading from the right, are worth 1, 16, 256, 4096 and so on, each sixteen times the last.
The most quoted example is FF. The first F is worth 15 in the sixteen place, giving 240, and the second F is worth 15 in the ones place, so FF adds up to 255. A4 works the same way: A is 10 in the sixteen place, giving 160, plus 4 gives 164.
One warning for anyone arriving from a design tool. A six digit hex color code, the kind that styles web pages, is not really one number. It is three byte values packed together: red, green and blue. The number itself still converts here, and the decimal figure is honest, but reading a color as a single value hides the three channels that make it meaningful.
Under the answer, the same value also appears in binary and octal. Hex and binary are close cousins, since one hex digit is exactly four bits, and seeing them side by side is the fastest way to sanity-check a conversion.
Hex pasted from real code is messy, and this page is built for it. Case does not matter, a 0x prefix is stripped with a note on screen, and a letter past F stops the conversion and gets named, position and all. The lazy alternative, quietly dropping the unreadable tail and converting what is left, produces confident wrong answers, and it does not happen here.
Length is not a trap either. Ordinary floating point maths loses exactness beyond 2 to the power of 53, which bites on long addresses and hashes. This converter uses arbitrary precision, so a long hex string converts digit for digit, with the working to prove it.
Signs stay simple and labelled: a negative value converts by size, with the minus sign carried as sign and magnitude. Two’s complement is not applied, since that format depends on a storage width the input does not state. Whole numbers only as well: a fraction after a point is flagged in the open, never silently dropped.
The conversion runs entirely in your browser. Nothing is uploaded or stored, there is no sign-up, and conversions are unlimited.
Give each digit its place value, counting from the right in powers of sixteen: 1, 16, 256, 4096. Multiply each digit by its place, remembering A to F mean 10 to 15, then add the results. FF is 15 x 16 + 15 = 255.
It is a label programmers put in code to say “this number is hex”. It is not part of the value. Paste it in as it comes and the tool strips it, with a note on screen.
The conversion stops and the digit is named, along with its position. Hex stops at F, and guessing past a bad digit would give you a wrong answer wearing a straight face.
Not really. A six digit color code is three bytes side by side: red, green and blue. Converting the whole string gives a valid decimal figure, but the three channels are what the code actually means.
As long as you can paste. Arbitrary precision maths keeps every digit exact, well past the 53-bit limit where ordinary calculator arithmetic starts rounding.
No. The maths runs on your device, in the browser, and nothing you paste is uploaded, stored or shared anywhere.
Same rules as this one: free, in your browser, with nothing uploaded.
Exact age in years, months and days for any form.
Marks, discounts and change, worked out properly.
Body mass index from height and weight, with its range.
Monthly loan payment, total interest and full cost.
The final price after a discount, and what you saved.
Add or remove GST at the rate your invoice uses.
Add tax to a price or pull it back out.
Work out a tip and split a bill between people.