Calculator inputs
Enter a hexadecimal value, or switch direction to convert decimal into hexadecimal.
Conversion history
Formula used
Each hexadecimal digit represents a power of sixteen. The rightmost whole-number digit uses position zero. Positions increase by one while moving left.
For example, 2AF16 equals 2 × 16² + 10 × 16¹ + 15 × 16⁰. These contributions are 512, 160, and 15. Their total is 68710.
Digits after the hexadecimal point use negative powers. The first fractional position represents sixteenths. Later positions represent 16⁻², 16⁻³, and beyond.
How to use this calculator
- Select the required conversion direction.
- Enter a hexadecimal or decimal number.
- Choose standard, unsigned, or two’s complement mode.
- Select the bit width when using two’s complement.
- Choose fractional precision and hexadecimal letter case.
- Press Calculate to view results and detailed steps.
- Copy, export, print, or review saved history.
The hexadecimal input accepts uppercase and lowercase letters. An optional 0x prefix is recognized automatically. Spaces, commas, and underscores can also be removed.
Two’s complement treats the entered hexadecimal value as a fixed-width bit pattern. The selected width controls the sign position and valid range. Fractional input is unavailable in this mode.
Hexadecimal conversion examples
| Hexadecimal | Decimal | Binary |
|---|---|---|
| A | 10 | 1010 |
| F | 15 | 1111 |
| 10 | 16 | 10000 |
| 1A | 26 | 11010 |
| FF | 255 | 11111111 |
| 100 | 256 | 100000000 |
| 2AF | 687 | 1010101111 |
| FFFF | 65535 | 1111111111111111 |
Understanding hexadecimal and decimal numbers
Hexadecimal is a base-sixteen numbering system. It uses decimal digits zero through nine. Letters A through F represent values ten through fifteen.
Programmers use hexadecimal because one digit matches four binary bits. Long binary values become shorter and easier to inspect. Memory addresses and color codes often use hexadecimal.
Decimal uses ten symbols and powers of ten. Converting hexadecimal requires multiplying each digit by its place value. Adding every contribution produces the decimal result.
This calculator performs that process automatically. It also displays binary, octal, digit counts, and ASCII text. Detailed rows help verify every whole-number position.
Signed magnitude keeps a visible minus sign. Unsigned mode allows only values at zero or above. Two’s complement stores negative values inside a fixed bit width.
Bit width matters because it controls the available numeric range. An eight-bit pattern contains two hexadecimal digits. Sixteen, thirty-two, and sixty-four-bit patterns allow increasingly larger values.
Fractional hexadecimal values use negative powers of sixteen. A digit after the point represents sixteenths. More digits add increasingly precise fractional contributions.
Large whole numbers are converted using decimal-string arithmetic. This avoids relying only on PHP integer limits. The calculator therefore handles values beyond common machine sizes.
Export tools make results easier to reuse. CSV files contain the main conversion and step table. Print mode can be saved as a PDF through the browser.
Input validation prevents unsupported symbols and malformed points. Clear messages explain bit-width overflow or signed-mode conflicts. This keeps every conversion understandable and dependable.
Frequently asked questions
1. What is hexadecimal?
Hexadecimal is a base-sixteen system using 0–9 and A–F.
2. What decimal value does A represent?
The hexadecimal digit A represents decimal value 10.
3. Can I enter a 0x prefix?
Yes. The calculator automatically recognizes 0x and 0X prefixes.
4. Are lowercase letters accepted?
Yes. Both lowercase and uppercase hexadecimal letters are valid.
5. Can this calculator convert fractions?
Yes. Hexadecimal and decimal fractional values are supported in standard modes.
6. What is two’s complement?
It is a fixed-width binary method for storing signed integers.
7. Why does bit width matter?
Bit width determines the sign position, valid range, and overflow limit.
8. Can I convert decimal back to hexadecimal?
Yes. Select Decimal to hexadecimal or press Swap direction.
9. How do I save the result as PDF?
Press PDF / Print, then choose Save as PDF in your browser.