JSON Formatter
Format and validate JSON with a clearer editor-style layout and a readable output panel.
How to format and validate JSON
- Paste JSON or open a .json file.
- Press Format to make it readable, or Minify to make it compact.
- If there is an error, the exact line and column are shown. Try Fix JSON for common mistakes.
- View it as code, a tree or a table, then copy or download.
Why use this tool
JSON is the data format used by almost every API, app config and web service. Minified JSON from an API is one long line that is hard to read; formatting adds indentation and line breaks. Validation finds the comma or quote that breaks your app.
Fix JSON repairs comments, trailing commas, single quotes and unquoted keys, which are common when copying from JavaScript. Everything runs in your browser, so API keys and private data stay on your device.
Frequently asked questions
Why is my JSON invalid?
The most common causes are a trailing comma, single quotes instead of double quotes, or a missing bracket. The error message shows the exact line.
Can I convert JSON to CSV?
Yes. Arrays of objects can be shown as a table and downloaded as CSV.
Is my data uploaded?
No. Formatting and validation happen in your browser.
Our test: fixing real broken JSON
We pasted JSON with two of the most common mistakes: single quotes and trailing commas, the kind you get when copying an object from JavaScript code.
{
'name': 'Sara',
"age": 31,
"skills": ["SQL", "Excel",],
}Pressing Format showed the error clearly: line 2, column 3: keys need double quotes, not single quotes. Pressing Fix JSON replaced the quotes and removed both extra commas, and the result was valid.
Other errors you will meet in real work
| Error | Where it usually comes from |
|---|---|
| Comments like // or /* */ | Config files copied from code. JSON does not allow comments. |
| Unexpected end of input | A response cut off, or a missing } at the end |
| NaN or undefined as a value | JavaScript output. Use null instead. |
| Strange characters at the start | A file saved with a hidden byte-order mark |
Tip for API work
If an API response will not format, check that you copied the body and not the headers. Also check the API really returned JSON: an HTML error page starts with < instead of {.