InTab

JSON Validator

Check JSON is valid and see the exact line, column and a fix hint when it is not.

Formatters: Pretty-print, minify, validate and compare. It runs in your browser, so nothing you enter is uploaded.

What it does

The JSON Validator checks whether text is valid JSON. When it is not, it points to the exact line and column of the problem, shows the line with an arrow under the broken character, and explains the likely fix in plain English.

How to use it

  1. Paste your JSON into the editor.
  2. Click Validate.
  3. Read the result: Valid JSON, or Invalid JSON with the position, a snippet and a hint.
  4. Fix the line and validate again, or click Auto-fix to repair it for you. The card then lists what was changed.

Example

{
  "name": "Ada",
  "skills": ["math", "code",],
}

This fails at line 3: the comma after "code" has nothing after it. The hint says Remove the trailing comma before the closing bracket. The same mistake appears again before the closing brace on line 4.

The mistakes it explains

Mistake Fix
Trailing comma [1, 2,] Remove the last comma
Single quotes 'name' Use double quotes "name"
Unquoted keys {name: 1} Quote the key: {"name": 1}
Comments // note Remove them; JSON has no comments
NaN, Infinity, undefined Use null or a number
Missing bracket or quote at the end Close the bracket, brace or string

Good to know

  • JSON is stricter than JavaScript: what works in a .js file can still be invalid JSON.
  • Configuration formats such as JSON5 or JSONC allow comments and trailing commas; standard JSON parsers do not.
  • Once it is valid, the JSON Formatter can indent, minify or sort it.

FAQ

Why is my file valid in my editor but invalid here? Editors such as VS Code often treat settings.json as JSONC (JSON with comments). Remove comments and trailing commas for strict JSON.

Does it check my data against a schema? No, it checks syntax only. To describe the shape of your data, JSON to Code can generate a JSON Schema from an example.

Guides

More Formatters tools

  • JSON Formatter: Beautify, minify, validate and sort JSON. Handles escaped/stringified JSON.
  • XML Formatter: Beautify, minify and validate XML documents.
  • SQL Formatter: Format SQL for MySQL, PostgreSQL, T-SQL, SQLite and more.
  • Diff Finder: Compare two texts or JSON documents line by line or word by word.
  • Text Diff Checker: Paste two versions of a text and see exactly which words changed.
  • JavaScript Formatter: Beautify minified or messy JavaScript with your choice of indentation.
  • JavaScript Minifier: Minify JavaScript with Terser: compress, shorten names and see the size saved.
  • HTML Formatter: Indent and tidy HTML, or minify it for production.
  • CSS Formatter: Beautify CSS with one rule per block and consistent indentation.
  • CSS Minifier: Minify CSS with CSSO: remove whitespace, merge rules and shorten values.
  • YAML Formatter: Validate and re-indent YAML, keeping comments, with optional key sorting.