JSON Formatter & Validator
Guide: How to Fix the Most Common JSON Errors
Nothing you enter or choose here leaves your device. This tool runs in your browser.
How to use
- 1Paste your JSON into the box. It is checked as you type.
- 2If it is invalid, read the message, line and column shown under the box.
- 3Pick an indent size, optionally sort keys, then click Prettify or Minify.
- 4Click Copy to copy the result.
Frequently asked questions
How do I find the error in my JSON?
The validator shows the line and column of the first problem, the text of that line and a marker under the exact spot. Common causes are trailing commas, single quotes and missing quotes around keys.
What is the difference between prettify and minify?
Prettify adds indentation and line breaks so humans can read it. Minify removes all unnecessary whitespace to make the smallest possible text.
Does sorting keys change my data?
It reorders object keys alphabetically, including nested objects. Array order is kept, and the values aren't changed.
Is my JSON sent to a server?
No. Parsing and formatting happen in your browser, so private data such as API responses stays on your device.
Read the guides
Learn how this works and how to get the most from it.
Developer
How to Fix the Most Common JSON Errors
Trailing commas, single quotes, unquoted keys and more. Learn to read a JSON error message and fix invalid JSON quickly.
1 min read
Developer
JSON vs YAML vs XML vs CSV: Choosing a Data Format
The strengths and weaknesses of JSON, YAML, XML and CSV, with simple advice on which to use for APIs, config files and spreadsheets.
1 min read
Related tools
JSON to DTO Generator
Turn JSON into Java, C#, TypeScript, Kotlin, Python or Go classes.
JSON Diff
Compare two JSON documents and see what changed, ignoring key order.
JSONPath Tester
Test JSONPath queries against your JSON and see every match.
YAML ⇄ JSON Converter
Convert YAML to JSON and JSON to YAML with error line numbers.