JSON Formatter & Validator
Ready to calculate
Last reviewed:
Free online JSON formatter and validator
Paste JSON to format, validate, minify or sort it instantly. Invalid JSON is flagged with the parser message and the line and column of the error. Choose 2 spaces, 4 spaces or tabs, or minify to a single line.
Everything runs in your browser. Your data is never uploaded or stored.
How to format JSON
Paste your JSON into the input box.
Pick the output style: 2 spaces, 4 spaces, tab, or minify.
Optionally sort keys A to Z, applied to every nested object.
Copy the result with one click. Errors show the line and column to fix.
Real-World Example
Calculation In Practice
When to use a JSON formatter
1
Reading API responses: Turn a minified payload into something you can scan.
2
Debugging config files: Find the missing comma or quote with the line and column.
3
Shrinking payloads: Minify JSON before embedding it in code or a request.
4
Diff-friendly output: Sort keys so two JSON files compare cleanly.
Frequently Asked Questions
Is my JSON uploaded anywhere?
No. Parsing and formatting happen entirely in your browser.
What counts as valid JSON?
Strict JSON: double-quoted keys and strings, no trailing commas, no comments.
Does sorting keys change the data?
No. It only reorders object keys alphabetically. Array order is preserved.
Why does the error show a line and column?
The browser JSON parser reports the character position of the first error. We convert it to a line and column to help you find it.