JSON ValidatorONLINE

Find JSON syntax errors with exact locations, explanations, and practical suggestions.

JSON
{
  "project": "Something worth building",
  "version": 1,
  "isPublic": true,
  "stack": [
    "Astro",
    "TypeScript",
    "JSON"
  ],
  "settings": {
    "theme": "light",
    "indent": 2
  },
  "description": null
}
Preparing editor…
Strict JSON · RFC 8259
Your JSON stays in your browser. Core processing happens locally.
Keyboard shortcuts & workspace limits

Ctrl / ⌘ + Enter runs the primary action. Ctrl / ⌘ + F searches the focused editor. Ctrl / ⌘ + Z undoes; add Shift to redo. Tab moves focus. Esc restores the expanded workspace.

Up to 10 MiB UTF-8 input, 128 nesting levels, and 32 Mi characters of output. The tree preview shows at most 2,000 nodes with bounded text. Syntax highlighting is disabled above one million characters; documents above 250,000 characters run on request. Export before reloading: documents are kept in memory, not saved.

THE PRACTICAL GUIDE

How to validate a JSON file and understand the first error

A syntax validator answers whether a document follows strict JSON grammar. It is useful when a parser rejects a payload and you need the location and likely cause of the first problem.

When should you use it?

  • Diagnose a failing API response or configuration file.
  • Check a hand-edited document before committing it.
  • Spot duplicate names that may be interpreted differently by downstream parsers.
WORKED EXAMPLE

Example: a trailing comma

The comma after the final property makes this invalid JSON. Remove it, then validate again.

Input
{"name":"Alex",}
Diagnostic
Trailing comma before }

Read the error in its surrounding context

A parser reports where it can no longer continue. If a comma is missing between two properties, that location may be the next property name rather than the preceding value. Look at the marked token and the text immediately before it. Fix one error, run the check again, and work forward through the document.

A response beginning with an HTML tag often means an API returned an error page. Removing the tag will not recover the expected response; check the HTTP status and response body in the application that made the request.

Separate grammar from application rules

A quoted number such as "42" is valid JSON, as is an empty object. Your application may require an integer id and a nonempty name. Those requirements belong in a schema or application validator. Duplicate property names deserve attention too: the syntax can be accepted, but different consumers may retain different values. This validator warns about them so you can resolve the ambiguity.

AT THE WORKBENCH

Find the first problem. Understand the fix.

Validation identifies the point where a parser can no longer continue. Review that location and the preceding token; an earlier missing comma can cause several later errors.

  1. Paste the failing document

    Your source remains unchanged during validation.

  2. Inspect the diagnostic

    Jump to the line, column, and zero-based character position.

  3. Correct and recheck

    Use the suggestion as guidance, then validate your edit.

IN PRACTICE

Why does a JavaScript object literal fail strict JSON validation?

JavaScript accepts syntax that JSON does not, including unquoted property names and single-quoted strings. JSON requires double-quoted names and string values, lowercase true and false, and no trailing comma. Paste the actual serialized text rather than a JavaScript expression to find the first invalid token.

JavaScript: the parser rejects a trailing comma

javascript
JSON.parse('{"ready":true,}'); // SyntaxError
JSON.parse('{"ready":true}');  // { ready: true }

The validator highlights the failure location in the source. Correct the comma and run it again; an earlier error can hide a later one.

No. Syntax validation checks grammar only. A request can parse successfully yet omit required fields or use a string where an integer is expected. Use JSON Schema Validator for those contract checks.

BEFORE YOU USE THE RESULT

What should you check before using the result?

Syntax validity says nothing about required application fields or data types. Use the JSON Schema Validator when a payload must satisfy a contract. A diagnostic may point after the actual missing token.

Syntax errors versus warnings

Missing commas, single-quoted names, incomplete strings, comments, and trailing commas are syntax errors. Duplicate property names are reported separately as warnings: the syntax is valid, but other parsers may discard values.

What this validator checks

A document must contain one strict JSON value. Objects, arrays, strings, numbers, booleans, and null are accepted at the root. Schema validation is a different task: this tool does not check required fields or business rules.

Understand JSON syntax

Technical reference: JSON syntax and interoperability · RFC 8259

THE JSON FIELD GUIDE
All guides