JSON Formatter
Paste any JSON to format it for readability, shrink it for transport, or find exactly where it breaks. Everything runs locally, so API responses and config files stay private.
🔒 Runs in your browser. Nothing is uploaded.
How to use
- Paste your JSON into the input box.
- Click "Format" to pretty-print with the chosen indentation, or "Minify" to remove all whitespace.
- Click "Validate" to check the syntax without changing anything. Errors show the line and column.
- Turn on "Sort keys" if you want object keys in alphabetical order (useful for diffs).
- Copy the result or download it as a .json file.
Examples
Reading an API response
A one-line response from curl or the browser network tab becomes readable with proper indentation and nesting.
Finding a broken config
A trailing comma or missing quote in package.json or a settings file is reported with its exact line and column.
Comparing two documents
Format both with "Sort keys" on, then diff them in your editor: key order no longer produces false differences.
Frequently asked questions
Why does it say my JSON is invalid?
Common causes: trailing commas after the last item, single quotes instead of double quotes, unquoted keys, comments, or a stray character. JSON is stricter than JavaScript object syntax.
Does minifying change the data?
No. Minify only removes whitespace between tokens. Strings, numbers and structure are unchanged. Note that JavaScript parses numbers as doubles, so integers above 2^53 may lose precision.
Is there a size limit?
There is no fixed limit, but very large documents (tens of MB) can be slow in a browser textarea. For huge files use a desktop editor.
Is my data uploaded?
No. Parsing and formatting use your browser's built-in JSON engine. Nothing is sent to a server, which makes this safe for data containing tokens or personal information.