JSON Formatter
Validate, format, and minify JSON in your browser. Preserve original number precision, string contents, and key order.
Validate, format, or minify JSON locally. Original number tokens and key order are preserved. Up to 1,000,000 characters.
How to use JSON Formatter
Paste valid JSON into the input.
Choose two-space formatting, four-space formatting, or minification.
Review the output, then copy it or download a JSON file.
Formatting without changing values
The JSON parser validates syntax, then the original tokens are formatted. This retains numeric spellings such as large integers, scientific notation, and negative zero. String contents, key order, and even duplicate keys are preserved rather than silently rewritten.
Valid JSON only
Use double quotes for keys and strings. JSON does not allow comments, trailing commas, undefined, or NaN. Valid top-level strings, numbers, booleans, and null are supported, not just objects and arrays.
Local processing and limits
Text stays in your browser. Inputs are limited to 1,000,000 characters; pretty formatting is limited to 100 nesting levels and 4,000,000 output characters. Use minification for deeply nested data. This is a syntax formatter, not a schema validator.