How to use the JSON formatter
- Paste your JSON into the left box, or click Open File.
- If it is valid, the formatted version appears on the right. If not, the message underneath says where the problem is.
- Choose a layout, or Minify to compress it, then click Copy or Download.
What the formatter does
- Beautify. Adds line breaks and indentation so nested data is easy to read.
- Validate. Checks that the JSON follows the rules and points to the first error.
- Minify. Removes every unnecessary space and line break to make the file as small as possible.
- Sort keys. Puts the names in each object in alphabetical order, which makes two files easier to compare.
Common JSON mistakes
| Mistake | Wrong | Right |
|---|---|---|
| Comma after the last item | [1, 2, 3,] | [1, 2, 3] |
| Single quote marks | {'name': 'Ana'} | {"name": "Ana"} |
| Names without quote marks | {name: "Ana"} | {"name": "Ana"} |
| Comments | {"a": 1} // note | {"a": 1} |
| Wrong capitals | True, None | true, null |
The rules of JSON in brief
JSON has six kinds of value: text in double quote marks, numbers, true, false, null, lists in square brackets and objects in curly braces. Object names must be in double quote marks, and items are separated by commas with none after the last one.
Need a different format? Convert with JSON to CSV, JSON to YAML or JSON to XML.
Your data stays on your device
The conversion runs entirely in your web browser. Nothing you paste or open is sent to a server, so it is safe to use with customer lists, exports and other private data. There is no sign-up and no size limit beyond what your device can handle.
Frequently asked questions
How do I format JSON?
Paste it into the left box. A neatly indented version appears on the right straight away.
How do I check if JSON is valid?
Paste it in. Valid JSON shows “Valid JSON”. Otherwise the message tells you the line and column of the first error.
How do I minify JSON?
Choose “Minify (one line)” under Layout and copy the result.
Is my JSON uploaded?
No. It is processed in your browser and never sent to a server.