A JSON document can be valid while a formatter changes a number inside it. If a tool parses every number into JavaScript's ordinary Number type before printing the result, some long integers and precise decimals cannot survive unchanged. Before formatting an API response or export, test a harmless sample with the kinds of values your document contains.
TechDriven's JSON Formatter preserves numeric literals while changing indentation. That protects the formatting step; the application that receives the output must still support the values you send it.
Reproduce the large-integer problem
JavaScript's maximum safe integer is 9007199254740991. Beyond the safe range, consecutive integers cannot all be represented exactly by the ordinary number type. MDN explains the boundary and its consequences.
For a small demonstration, run this in a JavaScript console:
JSON.stringify(JSON.parse('{"id":9007199254740993}'))
// {"id":9007199254740992}
The input is syntactically valid JSON. The final digit changes when the parser converts it into a JavaScript number. A formatting workflow built around that parse-and-print sequence can therefore alter an identifier without reporting a syntax error.
Once a value has already been rounded, adding indentation cannot reconstruct the missing digit. Return to the original response or export instead of trying to repair the rounded copy by guessing.
Try a sample with several numeric forms
Paste this synthetic example into the formatter, choose Format, and inspect the output:
{"id":9007199254740993,"amount":0.123456789012345678901,"scale":1e30,"zero":-0,"code":"0012"}
The expected formatted result is:
{
"id": 9007199254740993,
"amount": 0.123456789012345678901,
"scale": 1e30,
"zero": -0,
"code": "0012"
}
The tool preserves those numeric spellings, including the exponent and negative zero. The quoted code remains a string. Choose Minify to remove the indentation again; these values should still be unchanged. Preserving the text of a decimal is different from providing arbitrary-precision arithmetic on it.
Use dummy data for this check. An account identifier does not need to be real to demonstrate whether its digits survive.
Decide whether an identifier should be a string
If you control an API or export format, identifiers that are not used for arithmetic often belong in strings. For example, "0012" records a four-character code. The unquoted number 0012 is not valid JSON, and converting the code to 12 loses the leading zeros.
Use the type required by the receiving system. Replacing every numeric field with a string can break a schema or change how an application sorts and compares values. Fix the data contract deliberately rather than applying a blanket conversion.
The JSON standard allows implementations to limit numeric range and precision. A document that this formatter preserves may still exceed another parser's capabilities. See the interoperability discussion in RFC 8259, section 6.
Resolve duplicate keys before using the result
This site's formatter rejects repeated property names in the same object:
{"id":1,"id":2}
It reports an error instead of silently choosing one value. Check the original source and decide which field is correct, or give the two fields distinct names if they represent different things. Repetition in separate objects is a different case: [{"id":1},{"id":2}] has no duplicate key within either object.
Check the next conversion as well
Copying formatted JSON into a spreadsheet or another application introduces a new interpretation step. A spreadsheet may treat a long digit sequence as a number even when a CSV converter exported every digit correctly. Compare a representative value after import, not just in the downloaded file.
For CSV workflows, use the CSV and JSON conversion checklist to inspect leading zeros, quoted commas, empty fields and column counts. If you use JSON to CSV, keep the original JSON so nested structure and field types remain available for comparison.
For YAML conversion, confirm the receiving application's types too. A successful round trip through one tool does not establish that every parser uses the same numeric model.
A short verification routine
- Keep an untouched original.
- Format a sample containing a long integer, a precise decimal and a string code.
- Compare numeric tokens and string values before and after formatting.
- Resolve errors such as duplicate keys instead of accepting a partial result.
- Import the output into its destination and compare the same values again.
The formatter processes input locally in the browser. Keep credentials and private production payloads out of screenshots, shared clipboard history and test reports. Numeric preservation is a formatting property, not a security certification or a promise about downstream calculations.
Examples checked against this site's formatter implementation on 27 October 2026.