Why JSON turns out invalid
It is usually one of five things: a comma after the last element, single quotes instead of double, keys without quotes, comments, which standard JSON does not have, or the values undefined or NaN.
The validator shows the line and position of the error, so you do not have to hunt for it.

An example: finding the mistake
Take the line {'name': 'Olena', "age": 30,}. It looks almost right, but has two mistakes: the name and its key are in single quotes, and there is an extra comma after the number 30. The validator stops at the first of them and shows the position.
The corrected version: {"name": "Olena", "age": 30}. If the file is large, fix the mistakes one at a time and check again: after the first fix the validator shows the next one.
What values JSON can hold
There are few types: a string in double quotes, a number, true or false, null, an array in square brackets and an object in curly ones. Everything more complex is built from these. Dates have no type of their own, so they are written as a string, most often like 2026-12-02T10:00:00Z.
Hence a few traps. A number in quotes is already a string, and a program expecting a number may reject it. An empty string, null and a missing key mean different things. And the values undefined and NaN, or functions, do not exist in JSON at all: if they got into a file, it is invalid.
Formatting or minifying
Formatting adds indentation and line breaks so the data is easy to read. Minifying does the opposite: it removes the spaces to reduce the size before sending or storing it in a config.
Is minifying worth it
In a formatted file spaces and line breaks take up a noticeable share of the size, so minifying does make it smaller. But if the server compresses responses with gzip or brotli, as almost all do, the difference on the network becomes small: repeated spaces compress very well.
So the rule is simple. Keep what people read, such as configuration, examples in documentation and files in a repository, formatted. What only programs read can be minified, but the gain is usually modest.
How to compare two responses
Turn on key sorting: objects get ordered alphabetically, and two similar documents become easy to compare. Then paste both versions into the text comparison.
The tool for this: Diff checker
Where JSON turns up outside programming
The format has long since left the world of code. Many programs and browser extensions keep their settings in JSON, Telegram, Google and other services hand you the archive of your data in it, and it describes structured data on websites: the JSON-LD markup from which search engines take facts about a page.
So being able to read and check such a file is useful not only to developers. If a program stopped starting after you edited its settings by hand, an extra comma or a lost quote in the file is almost certainly the reason.
A simple example is a bookmarks or settings file that a program lets you export and import. If you edited it by hand and the import stopped working, paste the contents into the validator: it shows the line where the structure is broken, and you do not have to hunt for the mistake by eye among hundreds of similar lines.
Good habits
Save a copy of the file before editing a configuration. Do not edit minified JSON: format it first, make the changes, validate, and only then minify it again. Long numeric identifiers are better passed as strings: many programs round numbers larger than 9,007,199,254,740,991.
What to do with JSON next
If the data has to be shown to someone who does not work with code, turn it into a table: an array of objects becomes the rows of a CSV that Excel will open. If you need to see what changed between two responses, sort the keys and compare the texts. And the contents of a JWT are JSON too, only encoded: the decoder shows them in the familiar form.
The tool for this: JSON ↔ CSV, YAML, XML
How to do it
- Paste the JSON into the field.
- Run formatting or minifying.
- If there is an error, go to the line shown and fix it.
- Copy the result.
Tip. Data is processed in the browser, so you can paste responses with tokens or personal data. On someone else's computer, still close the tab when you finish.
Questions and answers
How does JSON differ from XML?
Both formats store structured data. JSON is shorter and simpler for programs; XML is wordier but supports attributes and schemas. New APIs mostly use JSON.
Can I open JSON in Excel?
Yes, if you turn it into CSV with the data converter: an array of objects becomes the rows of a table.
What is JSON-LD?
It is JSON with facts about a page for search engines: the organisation's name, a product, an article, questions and answers. It sits in the page's code in a script tag.
Can I leave a comma after the last element?
Not in JSON; it is an error. In JavaScript code such a comma is allowed, which is exactly why it often gets carried into JSON by accident.