What does a JSON formatter do?
JSON (JavaScript Object Notation) is the lingua franca of web APIs, configuration files and log pipelines. Machines happily exchange it as one long line, but humans need indentation to read it. This tool works in both directions: Format pretty-prints a document with 2 spaces, 4 spaces or tabs, and Minify strips every unnecessary whitespace character to make payloads as small as possible. Both modes validate the input against the JSON standard (RFC 8259) as you type.
Built for large documents
Processing runs in a background Web Worker, so even multi-megabyte API dumps or log exports are formatted without
freezing the page; you can also open a .json file directly and download the result. Everything happens in
your browser – your data is never uploaded. Inputs up to 500 KB are remembered in localStorage for
convenience; press Clear Data to remove them.
Your numbers stay exactly as written
Many online formatters call JSON.parse and JSON.stringify, which silently corrupt integers larger
than 253: the ID 9007199254740993 becomes 9007199254740992. Our engine never converts
values; it re-indents the original tokens, so big IDs, decimals such as 4.50 and escape sequences survive
untouched. Load the example to see it.
Error messages that point to the problem
When the JSON is invalid you get the exact line and column, the offending line with a marker and a plain-language explanation. The most common mistakes are:
- Trailing commas after the last item:
[1, 2, 3,]. - Single quotes or unquoted keys copied from JavaScript:
{name: 'Jane'}. - Comments (
//or/* */), which JSON does not support. - A missing comma between two properties.
Practical tips
Clean diffs with sorted keys
Enable Sort keys before comparing two API responses or committing a config file: properties are ordered alphabetically at every level, so a diff only shows real changes.
Command-line equivalents
$ jq . data.json # format
$ jq -c . data.json # minify
$ python -m json.tool data.json # format with Python