JSON Formatter
Format and explore JSON with collapsible sections, or convert Python dictionaries and lists.
On your device. Your input is not uploaded or saved.
How to format and validate JSON
- Paste JSON into the input, or press Load example JSON to try the tool.
- Choose Pretty print with 2 spaces, 4 spaces or tabs, or Minify to put everything on one line.
- Read the result as you type. Invalid JSON shows an error instead of output.
- Collapse or expand objects and arrays to explore nested data, then copy the complete result.
Validate JSON and find errors
The input is checked with the browser's strict JSON parser, so the tool also works as a JSON validator. Common errors are trailing commas, single quotes, unquoted keys, comments and missing brackets. When the browser reports where parsing stopped, the error message includes that position.
JSON mode follows JavaScript parsing: numbers beyond its safe range can lose precision, and when a key appears twice in the same object, the last value wins.
Explore large JSON
The formatted output has syntax highlighting and collapsible objects and arrays. Use Expand all and Collapse all to switch between an overview and the details, Focus output to give the result more room, or Plain text to select and copy freely. Input of up to 1,000,000 characters is supported.
Whitespace can trim spaces and line breaks around string keys, values or both, which helps clean up data copied from spreadsheets and forms. Numbers, booleans and null are not changed.
Convert a Python dict to JSON
Set Input syntax to Python dict / list to paste output from print() or a debugger. Single-quoted strings, True, False, None and tuples become valid JSON, and the conversion never runs Python code. Object representations such as <User object at 0x123> become strings, and large integers keep every digit.
Where does my data go?
Formatting happens in your browser as you type. The tool does not upload or save your JSON.
Like the rest of the site, this page uses Google Analytics and Yandex Metrica, including Metrica session replay. Tool events report only that the tool was opened or used.
The tool area is marked so that Metrica masks what you type and the results in its session recordings.
Also useful
No third-party trackers on JZR Tools. We count anonymous visits with country, referring site and device type only.