Format JSON without losing number precision
Buy me a coffeeFormat, validate and minify JSON without changing large numbers, key order or numeric spelling. Copy JSON or a Markdown code block. Runs locally.
Just useful tools.
See every JSON number stay intact
An API payload can contain an ID larger than JavaScript's safe integer range and decimals longer than its number type can represent. These outputs come from the same whitespace-only formatter and minifier as the tool above, without a parse-and-stringify rewrite.
Original payload
{"id":9007199254740993,"decimal":0.123456789012345678901,"scale":4.0,"exponent":1e+30,"negativeZero":-0}Pretty-printed / 2 spaces
{
"id": 9007199254740993,
"decimal": 0.123456789012345678901,
"scale": 4.0,
"exponent": 1e+30,
"negativeZero": -0
}Minified / same tokens
{"id":9007199254740993,"decimal":0.123456789012345678901,"scale":4.0,"exponent":1e+30,"negativeZero":-0}9007199254740993, 0.123456789012345678901, 4.0, 1e+30, and -0 retain their exact spelling. Key order and escaped strings are also preserved. This protects the source text; a downstream reader can still round numbers when it parses them.
A trailing comma is an error, not a repair request
{"items":[1,2,]}Line 1, column 15: Expected a JSON value; empty input and trailing commas are not allowed.
Comments and trailing commas are rejected. Duplicate keys remain in place with a warning because other readers may keep only the last value. This checks JSON syntax, not JSON Schema or your application's required fields.
JSON formatting without changing your data
Paste an API response, configuration file, or JSON payload to check its syntax before sharing it. Formatting changes whitespace, not values: large numeric IDs beyond JavaScript's safe integer range, exponent notation, negative zero, escaped strings, duplicate keys, and property order stay intact.
Pretty-print, minify, and copy JSON for documentation
Choose 2 spaces, 4 spaces, or tabs and select Format JSON for readable output. Minify removes whitespace outside strings. Copy JSON copies the output as text; Copy fenced JSON adds a Markdown code fence with the json language tag. Edit the file name and check the exact Saved as preview before downloading a .json file.
Strict validation, not automatic repair
Errors include one-based line and column locations. Comments, trailing commas, single-quoted strings, and incomplete values are rejected, never silently fixed. Duplicate keys are allowed by JSON syntax and kept in place, with a warning because other readers may discard earlier values. Up to 20 errors and 20 warnings are shown.
Local processing with explicit limits
Files stay in your browser. Imports are limited to 1 MB (1,000,000 bytes); all source input is limited to 200,000 characters and 49 nesting levels for reliable formatting and a responsive editor. Pretty-printed output is limited to 2,000,000 characters. Oversized input is rejected, not truncated. Source editing and undo remain separate from the read-only, selectable output.
Nothing is saved as a draft unless you enable Remember my work on this device. That option restores source, indentation, and file name locally; avoid enabling it for sensitive JSON on a shared device. Clear saved data removes all saved tool drafts. After editing the source or formatted indentation, create fresh output before copying or downloading.