What the formatter does
It parses your text as strict JSON (the grammar in RFC 8259) and prints it back with consistent indentation: one key per line, nested objects and arrays stepped in by the width you choose. The values themselves are never changed — only whitespace between tokens.
If the input is not valid JSON you get the first error with its line and column instead of a guess, so you can jump straight to the broken comma or quote. Pasting a JSON string that was itself escaped (for example "{\"id\":1}" copied out of a log) is detected and unwrapped automatically.
Formatting options
Indent with 2 spaces (the convention in most JavaScript projects and in JSON.stringify examples), 4 spaces (common in Python’s json.dumps output and many style guides), or tabs. "Sort keys" orders every object’s keys alphabetically, which makes two payloads much easier to compare by eye or in a text diff.
Frequently asked questions
Is my JSON uploaded anywhere?
No. Formatting happens in JavaScript on this page. The text you paste is never sent to a server, logged or stored. Only your option choices (like indent width) are remembered in your browser.
What is the difference between formatting and validating JSON?
Formatting re-indents valid JSON so it is readable. Validating checks whether the text is valid JSON at all and explains what is wrong if not. The formatter validates first, so an error always stops formatting and tells you where to look.
How big a file can I format?
Several megabytes format in well under a second on a laptop, because the work is done by your browser’s native JSON parser. Very large files (tens of MB) depend on your device memory.
Does formatting change my numbers?
Numbers are printed as JavaScript reads them. Integers beyond 9,007,199,254,740,991 (2^53 − 1) lose precision in any JavaScript-based tool, so the formatter warns you when it sees one.
Why does my JSON with comments fail?
Standard JSON does not allow comments, trailing commas or single-quoted strings. Those belong to JSON5 or JSONC (used by VS Code settings files). Remove them, or use the validator to find each one.