JSON Formatter & Validator
Format and validate JSON — make messy JSON pretty, minify it, see the exact line and column of an error, and fix mistakes with auto-fix.
No JSON yet — paste some JSON and press Format.
Everything happens in your browser — your JSON is never sent anywhere or saved.
How to format JSON in 3 steps
JSON (JavaScript Object Notation) is the format APIs, apps and websites use to send data. When JSON is one long line it is hard to read — this tool makes it readable.
Step 1: paste your JSON into the box above — or press Example JSON. Step 2: pick an indent size and a mode (Beautify or Minify), then press Format JSON — the pretty JSON appears below. Step 3: copy it with Copy Result, or shrink it to one line with Minify. If the JSON is wrong, the exact line and column of the error will be shown, and you can preview the Auto-Fix and press Apply.
Worked examples
| Broken: {"name": "Ahmed",} | Trailing comma — Auto-Fix removes it |
| Broken: {'name': 'Ahmed'} | Single quotes — Auto-Fix changes them to double quotes |
| Broken: {name: "Ahmed"} | Unquoted key — Auto-Fix adds quotes around name |
| Error: {"a": 1 "b": 2} | Missing comma — Line 1, Column 9, caret under "b" |
Indent size and file size
For the example {"name": "Ahmed", "site": "mailkarofree.blogspot.com", "tools": 12, "free": true}: beautified with a 2-space indent it is 91 characters, and minified it is 74 characters — 18.7% smaller than the beautified version. A 4-space or 8-space indent makes the readable version longer, so use 2 spaces for reading and Minify for sending. The size comparison table above the result shows the same numbers for your own JSON.
What is JSON validation?
Validation checks whether the JSON is written correctly — every bracket closed, every key in quotes, every comma in the right place. If there is a mistake, this tool shows its exact line and column, such as "Line 2, Column 5", and shows that line with a caret, so you can find the mistake at once.
What is the difference between Format and Minify?
Format indents JSON to make it readable — each key on its own line, brackets clear. Minify does the opposite — it removes all extra spaces and shrinks the JSON to one line, so the file is smaller and easier to send in an API.
JSON Formatter FAQ
Is the JSON Formatter free?
Yes. It is free, needs no login, and you can format as often as you like.
What happens if my JSON is invalid?
It shows "Invalid JSON" with the exact error message plus the exact line and column, and the offending line with a caret pointing at the problem.
What does Auto-Fix do?
Auto-Fix detects common problems — trailing commas, single quotes, and unquoted keys — and shows a fixed preview. Press Apply Fix to replace your input with the fixed JSON.
Is my JSON data sent to a server?
No. Everything runs in your browser. Your JSON is never sent, saved or shared.
What does Minify do?
Minify removes all extra spaces and line breaks, turning JSON into one compact line.
What is the difference between Format and Minify?
Format indents JSON to make it readable — each key on its own line. Minify does the opposite — it removes whitespace to make the JSON as small as possible.
How do I find the exact error in my JSON?
Paste the JSON and press Format JSON. If it is invalid, the tool shows the line and column of the error and the exact line with a caret under the bad character.
Can I fix trailing commas automatically?
Yes. Trailing commas before } or ] are the most common JSON mistake, and Auto-Fix removes them. Single quotes and unquoted keys are fixed too.
Can I sort JSON keys alphabetically?
Yes. Tick Sort keys A-Z and press Format JSON. Keys are sorted from A to Z at every level, and arrays keep their order.
How much smaller does Minify make my JSON?
It depends on the JSON. For the example with name, site, tools and free, the beautified version is 91 characters and the minified version is 74 characters — 18.7% smaller. The size comparison table shows the exact numbers for your own JSON.
Related tools
QR Code Generator · Unit Converter · Percentage Calculator · EMI Calculator · Discount Calculator · Currency Converter
Last updated: 24 November 2026
No comments:
Post a Comment