Developer Tools

JSON Validation Guide: What "Valid JSON" Does and Does Not Mean

By Smart Tools Utility Team · Published October 7, 2026 · Updated October 7, 2026 · 9 min read

A JSON validator answers one question: can this text be read as JSON? It is the fastest way to find out why a request body is rejected, why a config file will not load, or why an API response breaks your page. This guide covers how to use our JSON Validator, how to read what it tells you, why the error often points a line or two after the real mistake, which pasted-in problems cause the most trouble in practice, and what a "valid" result still does not prove.

Every result below was produced by running the tool. The wording of the error messages comes from a Chromium-based browser (the V8 JavaScript engine); Firefox and Safari phrase some of them differently, but the failing input and the fix are the same.

What the validator checks

The tool hands your text to the browser's built-in JSON parser. If the parser accepts it, the text follows the JSON grammar: braces and brackets balance, strings use double quotes, commas sit between items and nowhere else, and values are strings, numbers, true, false, null, objects or arrays. That is all it checks. It does not know what your data is supposed to contain. A document can be perfectly valid JSON and still be the wrong document for your API.

If you need to check structure and types, you want JSON Schema, which is a separate step covered further down.

How to validate JSON, step by step

  1. Paste your JSON into JSON Input for Validation.
  2. Click Validate JSON, or press Ctrl+Enter (Cmd+Enter on a Mac).
  3. Read the Validation Report. A pass lists four facts; a failure shows the parser's error message.
  4. Click Copy Report if you want to paste the result into a ticket or chat.
The JSON Validator with a small user object pasted in and a Validation Report reading VALIDATION PASSED, Data Type Object, Top Elements 2 Keys, Size Metrics 110 bytes
A passing check. The report gives the top-level type, how many keys or items it holds, and the size in bytes.

The four lines of a passing report mean:

Each run is saved in Validation History (Local), up to the last 20 in your browser's local storage. Click an entry to bring the input and report back.

Why the error often points to the wrong place

A parser reports where it noticed the problem, which is not always where you made it. The classic example is a missing closing bracket. This document has a mistake on line 4 (the array never closes):

{
  "user": {
    "id": 1,
    "tags": ["a", "b"
  },
  "ok": true
}
The JSON Validator showing a Syntax Error Detected banner and a report saying VALIDATION FAILED with error text Expected comma or closing bracket after array element at position 51, line 5 column 3
The parser complains about line 5, column 3, the closing brace, because that is where it expected a comma or a closing bracket.

The report says Expected ',' or ']' after array element in JSON at position 51 (line 5 column 3). Line 5 is the } that closes user. The parser was still inside the array, so a brace was the first thing that made no sense. The fix is on the line above: add the missing ]. The rule of thumb is to read the message, look at the reported position, and then look at the last few tokens before it. Position numbers count characters from 0; the line and column are counted from 1.

The tool shows a short Syntax Error Detected! banner above the report, and the actual reason sits in the Error Reason line inside the Validation Report box. Our JSON Formatter guide lists the ten most common syntax slips (trailing commas, single quotes, comments, and so on) with their messages, so this guide concentrates on the problems that come from copying and pasting.

Problems that come from copy and paste

Hand-typed JSON fails in predictable ways. JSON that was copied from somewhere else fails in stranger ones. These are the cases we see most, with what the tool reports:

One case goes the other way. A byte order mark (BOM) at the very start of a file, the invisible character some editors add to UTF-8 files, makes strict parsers reject the document. The validator accepts it, because the tool trims whitespace-like characters from both ends before parsing, and the BOM counts as one of them. We pasted {"a":1} with a BOM in front and it passed with a size of 7 bytes. If a different system rejects a file that this tool accepts, a BOM is a likely suspect.

Want to check a JSON document right now?

Open the JSON Validator

Valid does not mean correct

These all pass, and all can be wrong for the job:

The report's wording, Compliant with standard spec and completely valid configuration syntax, refers to syntax only. It is not a statement about your data being right.

Going beyond syntax

To check content, you need rules that describe the expected shape: required fields, allowed types, value ranges. That is what JSON Schema is for. This validator does not apply a schema, but you can get a starting point from a sample document with the JSON Schema Generator and then tighten it by hand. For a quick manual spot check of one value, the JSON Path Tester lets you pull out a specific path such as $.data.items[0].id and see whether it exists.

A sensible routine for API work is: check that the response is JSON at all (this tool), then check that it has the fields you rely on (a schema or a few path checks), and only then write the code that consumes it. When a response suddenly stops parsing, validating a saved copy often shows within seconds that the cause was an HTML error page, a truncated body or an extra character at the end.

Privacy: what happens to the text you paste

We loaded the validator and ran dozens of documents through it while watching network activity. After the page had loaded, it made no requests. The checking is done by your browser. The page does fetch its styling from a public CDN when it opens, and, as on most free sites, third-party advertising can appear on it. Neither receives your input from our code. Even so, remove tokens, passwords and personal data from anything you paste into any website, or validate it locally with jq empty file.json (it exits with an error code when the file is not valid JSON) or python3 -m json.tool file.json.

The history described above keeps the first 500 characters of each input in your browser's local storage until you press Clear All.

Quick answers

Does it fix the JSON for me? No. It reports the first problem the parser meets and stops there. After you fix it, validate again, because there may be more.

Why does it only show one error? The browser's parser stops at the first failure and the tool shows that message. Fix, re-run, and repeat.

Does it support comments or JSON5? No. It follows the JSON standard, so comments, single quotes and trailing commas fail.

I want it nicely indented as well. Use the JSON Formatter, which validates while it formats.

Want to check a JSON document right now?

Open the JSON Validator