Practical guide
Convert a Large Decimal ID to Hex Without Rounding
Translate an integer larger than JavaScript's safe Number range into hex while preserving every digit.
Prepared by DoItAl · Worked examples checked . How examples are checked and corrected
The job: inspect a large integer exactly
Suppose a system log prints the invented decimal identifier below and a diagnostic tool expects hex. Open Binary / Decimal / Hex Converter, choose Decimal as the input base, and paste the identifier as text. The converter reads integer digits into BigInt instead of first turning them into a JavaScript Number.
Copy the hex output as text and keep the original decimal value beside it. The value is one above 2^53, where ordinary JavaScript Number arithmetic can no longer represent every consecutive integer.
9007199254740993Check the result in both directions
The current engine returns hexadecimal 20000000000001 for this decimal input. Select Hexadecimal, paste that output, and check that the decimal result is the original 9007199254740993. The table is an exact integer conversion, not a rounded display approximation.
The tool also shows binary and octal, so you can compare a value from a low-level log without changing the underlying integer.
| Base | Exact output |
|---|---|
| Decimal | 9007199254740993 |
| Hexadecimal | 20000000000001 |
| Octal | 400000000000000001 |
| Binary | 100000000000000000000000000000000000000000000000000001 |
Understand the limits before copying
Choose the source base explicitly. Hex letters such as FF are invalid in Decimal mode; a 0x prefix is accepted only when Hexadecimal is selected. The tool accepts a leading sign and optional matching 0b, 0o or 0x prefix, then returns signed mathematical notation, such as -A for negative ten in hex.
It handles up to 4,096 input characters but rejects fractions, separators and scientific notation. It does not interpret bytes as text, infer a fixed bit width, or produce two's-complement machine words. A JSON tree preview can round an integer this large; use JSON Formatter's text output if you need to inspect the original JSON spelling.
Material update: