JSON Formatter
Format minified or messy JSON into readable, indented JSON. Choose 2 spaces, 4 spaces or tabs and optionally sort keys alphabetically.
What is the JSON Formatter?
JSON (JavaScript Object Notation) is the most common format for APIs and configuration. Formatting adds line breaks and indentation so nested data is easy to read and review.
How does it work?
Your input is parsed with the browser’s standards-compliant JSON parser and printed back with the chosen indentation. If parsing fails, the error message shows the line and column.
Example
{"a":1,"b":[1,2]} becomes a multi-line document with each key on its own line.
Frequently asked questions
Is my data sent to a server?
No. This tool runs entirely in your browser; nothing you paste is uploaded or stored.
Why is my JSON invalid?
Common causes are trailing commas, single quotes instead of double quotes, unquoted keys, comments, and NaN or undefined values — none of which are allowed in JSON.
Related tools
Enable JavaScript to use this calculator.