What makes JSON valid?
JSON is a strict text format for structured data. It allows objects in curly braces, arrays in square brackets, strings, numbers, true, false, and null. Its strictness is exactly what makes it useful between systems, but it also means small slips break everything. A parser either accepts the whole document or rejects it.
The rules people trip over most are: keys and strings must use double quotes (single quotes are not allowed), there can be no trailing comma after the last item, comments are not part of the format, and values like undefined or NaN are not valid. Text that looks fine in a JavaScript file can still be invalid JSON.
When to validate JSON before using it
A validator is the quickest way to find out whether a config file, API request body, or exported data will actually parse. If an application throws a vague "unexpected token" error, pasting the data here shows you whether the problem is the JSON itself or something later in your code.
It is useful for hand-edited files too, such as package settings, translation files, and feature flag configs, where a single missing comma can stop a build. If the JSON is valid but hard to read, the JSON Formatter will lay it out with indentation so structure is easier to follow.
How to validate JSON with this tool
- Paste your JSON into the "Paste your JSON" box on the left. A small sample is there to start, which you can replace.
- Look at the "Validation result" panel on the right. It shows a green check and "Your JSON is valid." when it parses, or a red cross with the error message when it does not.
- Fix the problem in the text box and the result updates automatically as you edit.
There is no validate button because the check runs on every change. The check happens in your browser, so the data is not uploaded. If the box is empty, it is treated as having nothing to check and shows as valid.
Reading error messages and knowing the limits
The error text comes straight from your browser's own JSON parser, so its wording and detail depend on which browser you use. Many include the position or the unexpected character, which points you to the area to inspect. Remember that the reported spot is where the parser gave up, which is sometimes just after the real mistake: a missing comma, for instance, is often reported at the start of the next item.
Fix one error at a time, since the parser stops at the first problem it finds. Also note that this tool checks syntax only. It confirms the document is well-formed JSON, but it does not check the data against a schema, so it cannot tell you whether required fields are present or whether a value has the right type for your application.