Math & Number Utilities100% Client-Side

Convert Decimal to Hexadecimal

Paste a base-10 integer to get its hexadecimal equivalent. The converter uses uppercase A through F for digit values ten through fifteen. It preserves the integer exactly within its supported range and represents negatives with a minus sign. Use it to compare a decimal label with a value shown in hex or to prepare a sample that needs a known base-sixteen spelling.

Input
2 chars•1 lines
Output

Reverse tool

Hexadecimal to Decimal Converter

Convert hexadecimal whole numbers to exact decimal values. Paste uppercase or lowercase digits with an optional sign and 0x prefix for a test or review.

Open Hexadecimal to Decimal Converter
Example input
2A
Example output
42

How to Use the Decimal to Hexadecimal Converter Online

  1. 1Paste one whole number written in base 10. Check that its digits belong to that base.
  2. 2Use 0 through 9 for the source magnitude, with an explicit sign when your integer is negative.
  3. 3Read the equivalent hexadecimal digits and check any minus sign before copying the result into a fixture.
  4. 4Record both bases with the example. Add any field width, prefix, or spacing separately when the destination requires a particular display.

Input & Output Examples

The result represents the same integer, 42 in base ten, written in base 16.

Input Sample
42
Expected Output
2A

This whole number is above the range of exactly represented consecutive JavaScript Number integers. The exact hex result still ends in 1.

Input Sample
9_007_199_254_740_993
Expected Output
20000000000001

Practical Developer Workflows

  • Translate a decimal fixture value to the hex spelling expected by a parser.
  • Use a larger number to check that the result stays exact.
  • Compare the value of a positive integer and its negative magnitude in hex.

Zero Server Uploads & Complete Privacy

Runs 100% in your browser; no data is uploaded to any server.

Notice a bug, calculation error, or outdated info?

Let us know directly so our engineering team can fix it.

Frequently Asked Questions

A hex place to the left of the rightmost digit is worth sixteen. Each F has a digit value of fifteen. Fifteen sixteens plus fifteen ones totals 255 in decimal, giving the two-digit result FF.

Explore Other Tools

12 suggested tools

View all tools