JSON Formatter
JSON
Result
ExampleAbout
JSON (JavaScript Object Notation) is a lightweight text format for structured data, widely used in APIs, configuration files, and data storage. Its simplicity and language independence have made it the dominant data interchange format on the web.
How to use
1.
Paste your JSON into the JSON panel
2.
Choose Format or Minify; when formatting, set Indent to 2, 4 or Tab - the Result panel updates as you type
3.
Copy or download the result, or fix the error the Result panel shows instead
Common uses
▸
Reading API responses that arrive as a single unformatted line
▸
Minifying JSON config files before committing or deploying
▸
Validating JSON syntax before parsing it in code
Similar tools
Frequently asked questions
What indentation does the formatter use?
The formatter uses 2-space indentation by default, which is the most common convention for JSON. Use the Indent option above the panels to switch to 4 spaces or tabs.
Does formatting change my data?
No. Only the whitespace between values changes. Numbers are copied exactly as written - including integers too large for JavaScript such as 12345678901234567890, and forms like 1.0 or 1e400 - and string escapes and key order are kept. Duplicate keys are kept too, with a warning, because most JSON parsers silently keep only the last one.
Can it detect JSON errors?
If your JSON has a syntax error, the tool shows the parser's error message - including the line and column when the browser reports them - so you can locate and fix the problem. When the JSON parses, the Result header shows Valid JSON.
Is my data sent to a server?
All formatting and validation runs in your browser. No JSON is transmitted to any server.
What is the difference between Format and Minify?
Format adds whitespace and indentation to make JSON human-readable. Minify removes all unnecessary whitespace to make JSON as compact as possible for transmission.