consolelog.tools

JSON Validator

Validate JSON live — a precise line:column code-frame on the error, a structure summary, and optional lenient mode.

About this ToolHow it works, benefits & use cases

The JSON Validator checks whether your JSON is syntactically valid and, when it is not, tells you exactly where the problem is. Paste JSON and it parses it live, showing a green "Valid JSON" confirmation or a red error that includes the message, the line and column, and a code-frame snippet with a caret pointing at the offending character. For valid input it produces a structure summary: the root type, total key count, maximum nesting depth, and the number of objects and arrays, plus the byte size. A "Lenient (repair)" toggle accepts non-strict input — comments, trailing commas, single-quoted strings, and unquoted keys — and repairs it before validating, flagging when a repair was applied. Two example buttons let you load a clean sample or a deliberately broken one to see the error reporting in action. Everything runs in your browser with no upload, and it is free to use.

How to Use

  1. 1Paste your JSON into the input panel, or use "Load example" for a valid sample or "Broken sample" to see error reporting.
  2. 2Optionally enable "Lenient (repair)" in Options to accept comments, trailing commas, or single quotes.
  3. 3Validation runs live; click "Validate JSON" to confirm the result.
  4. 4On success, read the "Valid JSON" banner and review the structure summary (root type, keys, depth, objects, arrays, bytes).
  5. 5On failure, use the code-frame error with its line:column and caret to locate and fix the syntax problem.

Key Benefits

  • Pinpoints errors with a precise line:column and a caret in a code-frame snippet
  • Structure summary: root type, total keys, max depth, object/array counts, and byte size
  • Lenient mode repairs comments, trailing commas, single quotes, and unquoted keys
  • Shows when input was repaired before validating
  • Built-in valid and broken samples to demonstrate both outcomes
  • Live validation updates as you type
  • Runs entirely in the browser — JSON is never uploaded

Common Use Cases

  • Finding the exact location of a syntax error in a large JSON payload
  • Validating an API response or config file before using it
  • Cleaning up a hand-edited JSON snippet with lenient repair, then confirming it parses
  • Inspecting the depth and key count of an unfamiliar JSON document
  • Demonstrating common JSON mistakes (missing commas, trailing commas) to a teammate

Options

Accept comments / trailing commas / single quotes

0 characters · live

Was this tool helpful?

Share Your Experience

Help others discover this tool!

Related tools