JSON Formatter
Format, validate and minify JSON in your browser. Shows the line and column of any syntax error, with indent and sort-keys options. Free, private.
✓ Valid JSON
Readable, valid JSON
Paste JSON from an API response, log file or config and the tool checks it instantly. If it's invalid, you get the parser's error and the line and column where it went wrong, which is usually a missing comma, a trailing comma or single quotes instead of double. Format pretty-prints it with 2 spaces, 4 spaces or tabs; Minify strips all whitespace to make it as small as possible; Sort keys orders object keys alphabetically, which makes two JSON files easier to compare. Your data never leaves your browser, so it's safe for tokens and private payloads.
How to use it
- 1
Paste your JSON
It's validated as you type.
- 2
Fix any errors
The message shows the line and column of the problem.
- 3
Format or minify
Then copy the result.
Frequently asked questions
Why is my JSON invalid?
The most common causes are a trailing comma after the last item, single quotes instead of double quotes, unquoted keys and comments. JSON allows none of these.
Is my JSON uploaded?
No. Parsing and formatting happen in your browser with JSON.parse; nothing is sent anywhere.
What's the difference between formatting and minifying?
Formatting adds line breaks and indentation for people to read; minifying removes them so the file is smaller for machines.
Can it handle large files?
Yes, several megabytes are fine on most computers.