Convert hex to decimal and back with exact results, signed values, fractions and batch lists.
Accepts 0x, #, $, \x and h-suffix styles, upper or lower case, spaces or underscores between digits, a leading minus and one point for fractions (1A.8). Up to 10,000 digits.
Up to 1,000 lines. Blank lines are skipped.
Add a leading 0 to see the byte view: it needs whole bytes (an even number of digits, up to 16 bytes).
Each hex digit is multiplied by 16 raised to its position, then the products are added.
| Position | Digit | Value | Place value | Product |
|---|
| Input | Decimal | Error |
|---|
Accepts whole numbers of any size, commas, spaces or underscores as thousands separators, a leading minus and decimal fractions (0.5).
Up to 1,000 lines. Blank lines are skipped.
| Input | Hex | Error |
|---|
| Hex | Decimal | Binary |
|---|---|---|
| 0 | 0 | 0000 |
| 1 | 1 | 0001 |
| 2 | 2 | 0010 |
| 3 | 3 | 0011 |
| 4 | 4 | 0100 |
| 5 | 5 | 0101 |
| 6 | 6 | 0110 |
| 7 | 7 | 0111 |
| 8 | 8 | 1000 |
| 9 | 9 | 1001 |
| A | 10 | 1010 |
| B | 11 | 1011 |
| C | 12 | 1100 |
| D | 13 | 1101 |
| E | 14 | 1110 |
| F | 15 | 1111 |
This hex to decimal converter turns any hexadecimal value, such as FF, 0x7FFFFFFF or #FF8800, into an exact decimal number. It is made for programmers, students and designers. It also shows binary, octal, signed values, byte order and a step-by-step breakdown. A second tab converts decimal back to hex.
Hexadecimal to decimal conversion rewrites a base-16 number as a base-10 number. Hex uses sixteen symbols: the digits 0 to 9 and the letters A to F, where A is 10 and F is 15. Each position is worth a power of 16, so reading from the right the places are worth 1, 16, 256, 4,096 and so on.
To convert by hand, multiply each digit by 16 raised to its position, then add the products. For 2F, that is 2 × 16 + 15 × 1 = 47. Programmers like hex because one hex digit equals exactly four bits, so two digits describe one byte.
| Hex digit | Decimal | Binary |
|---|---|---|
| A | 10 | 1010 |
| B | 11 | 1011 |
| C | 12 | 1100 |
| D | 13 | 1101 |
| E | 14 | 1110 |
| F | 15 | 1111 |
You can convert a hex value in a few clicks: enter the value, pick how to read it, and copy the result. Follow these steps.
The examples below show how the same hex digits can produce different decimal numbers depending on the interpretation you choose.
Searchers often ask what FF is in decimal. FF is 15 × 16 + 15 = 255, the largest value of one byte. Hex 10 is 16 and hex 20 is 32, because the left digit counts groups of 16.
0x7FFFFFFF converts to 2,147,483,647, the largest signed 32-bit integer. FFFFFFFF converts to 4,294,967,295 when read as unsigned. Switch Interpretation to Two's complement with a 32-bit width and the same digits become -1, because the top bit is set and the value is 4,294,967,295 minus 232.
As a plain number, FF8800 is 255 × 65,536 + 136 × 256 + 0 = 16,746,496. The tool also notes that the value can be read as a CSS color, which here is rgb(255, 136, 0), a bright orange.
Digits after the point are worth 1/16, 1/256 and so on. For 1A.8: 1 × 16 + 10 = 26, plus 8 ÷ 16 = 0.5, so the result is 26.5.
0x1234 is 1 × 4,096 + 2 × 256 + 3 × 16 + 4 = 4,660. The little-endian value reverses the bytes (12 34 becomes 34 12), which gives 0x3412, or 13,330 in decimal.
Each output line answers a different question, so pick the one that matches your task.
Switch to the Decimal to Hex tab, enter a number in Decimal number (or one per line in batch mode) and read the hex result. You can add a 0x prefix, choose Uppercase (FF) or Lowercase (ff), and pad with zeros to 2, 4, 8, 16 or 32 digits for 8, 16, 32, 64 or 128-bit fields.
Fractions are supported, with a Fraction digits setting from 1 to 256. For negative numbers, choose between a minus sign (-FF) and two's complement, with Auto (whole bytes) or a fixed bit width. For example, -1 in 8-bit two's complement is FF.
The tool fits any job where hex values come from one system and decimal values from another.
If you need arithmetic on hex values rather than conversion, the hex calculator adds, subtracts and applies bitwise operations. To see the same number in base 2, the binary calculator is a good companion.
Hex has no sign of its own. FFFE is 65,534 as unsigned 16-bit and -2 as signed 16-bit. Decide which one your data format uses before you copy a number into code.
Hex only allows 0 to 9 and A to F. A letter like G or O triggers an error that points to the character's position. Only one point is allowed, so 1A.8.4 is rejected. Commas inside a value are also flagged.
If you pick 8-bit and enter 1FF, the value needs 9 bits, so the tool asks you to choose a wider width. Increase the width or use Auto.
In Auto mode each digit counts as four bits, so 00FF is 16 bits wide while FF is 8. This changes the signed result, so keep the zeros your source data has.
Excel's HEX2DEC function accepts up to 10 hex characters. Python's int("ff", 16) returns 255 for any length but does not show steps. Use this page when you need long values, a signed reading or the working.
A network capture usually lists bytes in the order sent, while a CPU register dump may show them reversed. Compare both byte views with the number you expect before trusting either.
A single value can have up to 10,000 hex digits, and batch mode accepts up to 1,000 lines. The step-by-step table is meant for shorter values, so very long inputs show the result without a full breakdown. Colors only apply to six or eight digit values. The converter works with numbers, not text. To turn character codes into readable words, use the decimal to ASCII converter or the binary translator.
Paste your value above to get the exact decimal, the signed reading and the working in one step. Related utilities are collected in the online calculators and utilities hub.
Your report has been submitted. We will look into this issue.
A VPN changes your network exit. It does not guarantee anonymity.
Themes, plugins, code, video, audio, graphics & more from 90,000+ authors.
Web Development
Design & Media
Unlimited Access
Explore Envato Market