JSON formatting and validation: a friendly guide for everyone
JSON is everywhere — in APIs, configuration files and even the data exported from your favourite apps. This guide explains how to read it, format it and fix the most common errors.
What is JSON?
JSON stands for JavaScript Object Notation. It is a lightweight text format for storing structured data. A simple JSON object looks like this:
{
"name": "CrashClaim.Store",
"year": 2026,
"free": true
}
Why formatting matters
JSON is valid whether it is on one line or pretty-printed across many. But humans need indentation to spot mistakes. A formatter like the one on this site adds line breaks and consistent indentation so you can scan a document in seconds.
Pretty vs minify
Pretty indents the document for reading; minify removes every optional space for transmission. Use pretty for development and minify for production payloads.
Common JSON errors
- Trailing comma: JSON does not allow a comma after the last item in an object or array.
- Single quotes: keys and strings must use double quotes.
- Unquoted keys: all keys must be strings in double quotes.
- Comments: standard JSON does not support comments.
Reading an error message
Browser-based validators will often report something like Unexpected token } in JSON at position 73. That position is a character offset from the start of the document. Open your text editor, jump to that character and look just before it — the actual mistake is usually one character earlier.
Try it
Paste any JSON into our JSON Formatter to pretty-print or minify it, and our JSON Validator to confirm it is syntactically correct.
Beyond JSON
Once you are comfortable, explore Base64 encoding with our Base64 Encoder and URL escaping with our URL Encoder. These three tools cover most of the everyday "data plumbing" work in a typical web project.