Decimal to HEX

Write an exact decimal integer in hexadecimal even when it exceeds the safe integer range in JavaScript.

Write an exact decimal integer in hexadecimal even when it exceeds the safe integer range in JavaScript.

How to use

  1. Copy the sample’s digits from a source that keeps them as text.
  2. Paste the number and convert to base sixteen without adding separators.
  3. Compare every digit of the output with the example, including the final 1.

Worked example

Input

9007199254740993

Expected result

20000000000001

Check the result

The last digit is a useful check that the input was not rounded in transit.

Continue with another guide

Cookie
We care about your data and would love to use cookies to improve your experience.

Learn how we use cookies