JSON formatter
Validate strict JSON, format indentation, minify or recursively sort object keys without changing numeric or string literals. Browse a collapsible tree, search keys, values, and JSON pointers, and get precise errors and duplicate-key warnings.
Find & replace in input
Undo: Ctrl/Cmd+Z · Redo: Ctrl/Cmd+Shift+Z or Ctrl+Y. Up to 20 steps and 4 million retained characters in this tab. Clear discards history.
Sorting changes object key order recursively; array order and duplicate-key order are preserved. Keys use UTF-16 order.
Three small steps.
- Paste a JSON document or load a local text file.
- Choose Format or Minify.
- Review validation messages, then copy or download the result.
A few things to know.
Strict JSON only: comments and trailing commas are rejected. Optional key sorting compares decoded keys in UTF-16 order recursively; arrays and identical-key order are preserved. Formatting preserves the source spelling of numbers and strings. Duplicate keys are flagged, not removed. Limit: 1 million characters and 256 nesting levels. Tree view supports up to 10,000 syntax nodes and 2 million characters of paths and values, and displays children in groups of 100. Larger documents still produce a full formatted result.
How your privacy works →A little more clarity.
Are large integers preserved?
Yes. Formatting operates on source tokens instead of converting numbers to JavaScript Number values. A literal such as 9007199254740993 is kept as written.
Will invalid JSON be repaired automatically?
No. A validation message identifies the problem. Your original text stays intact so you can decide how to fix it.