Home/Tools/Developer Tools/JSON Validator
JSON Validator & Linter
Developer ToolsProcessed in your browser. A copy of each run is saved to your past runs so you can reopen it. Privacy
What the JSON Validator does
The JSON Validator checks whether a document is valid JSON and, when it is not, points at the first problem with its line, column and a fix written in plain English: a trailing comma, single quotes, an unquoted key, a comment, a missing comma. It also accepts JSONC and JSON5, can auto-fix the common mistakes, and formats or minifies valid input. It validates syntax only; it does not check data against a JSON Schema.
How to use it
- 1Paste JSON into the Input panel or upload a .json file.
- 2Choose the dialect: Strict JSON (the default, what APIs expect), JSONC (allows comments and trailing commas, as in VS Code settings) or JSON5.
- 3Press Validate (or Cmd/Ctrl+Enter). A green box confirms valid input; a red box names the line, column, problem and fix, with the offending line shown under a caret.
- 4Fix the input and validate again, or press Auto-fix to let the tool rewrite the common mistakes as strict JSON and list what it changed.
- 5Use Format (2 or 4 spaces) or Minify on valid input, then copy or download it.
Options explained
- Strict JSON
- RFC 8259 rules: double quotes only, no comments, no trailing commas, no NaN. Use it for anything an API, a database or JSON.parse() will read.
- JSONC
- JSON with // and /* */ comments and trailing commas, the dialect of VS Code and TypeScript config files. Use it to check settings.json or tsconfig.json without false errors.
- JSON5
- Also allows single quotes, unquoted keys, hex numbers, leading + and multi-line strings. Use it for JSON5 config files; remember that most servers will not accept it.
- Auto-fix
- Parses the input permissively, then writes it back out as strict JSON with 2-space indentation and lists every change by line and column: comments removed, keys quoted, single quotes replaced, trailing commas dropped. Use it on hand-written or copied-from-JavaScript objects. It cannot invent missing commas or brackets; those still need you.
- Format (2 or 4) and Minify
- Pretty-print with the indentation your project uses, or strip all whitespace for an HTTP body or environment variable. Both run only after validation succeeds.
- Upload
- Reads a local .json, .jsonc or .json5 file into the input. Files up to 10 MB are parsed in the browser.
Common problems and limits
Like every parser, the validator stops at the first error. Fix it, validate again, and the next one (if any) appears; three or four passes clear most files.
Input is limited to 10 MB. Larger files should be split or checked with a command-line tool such as jq.
Duplicate keys are legal JSON but almost always a mistake, so they are reported as a warning rather than an error; most parsers keep the last value.
This is a syntax check, not a JSON Schema check. It will tell you the document is well-formed, not that 'price' is a number or 'email' is required.
Error positions are counted in characters from the start of the line (tabs count as one), which matches most editors' column display.
Who uses it
- Backend and frontend developers: Find out why JSON.parse() threw 'Unexpected token' before you commit, with the exact column instead of a character offset.
- API consumers: Paste a response body from a failing integration and learn in one click whether the problem is the payload or your code.
- DevOps: Check settings.json, tsconfig.json or a package manifest after a merge; JSONC mode keeps the comments from being flagged.
- Ecommerce and data teams: Validate a product feed or a webhook payload exported from a platform before loading it into a spreadsheet or the JSON to CSV converter.
- Students and writers of documentation: Make sure every JSON example in a tutorial actually parses, including the ones typed by hand.
Frequently asked
How do I validate JSON?
Paste it here and press Validate. The tool parses it with the same rules JSON.parse() uses and reports the first problem with line, column and a suggested fix. For a quick check in code, wrap JSON.parse() in a try/catch or run python -m json.tool file.json.
What is JSONLint?
JSONLint is the name of a long-running online JSON validator, and 'json lint' has become the generic term for checking JSON syntax. This page does the same job, adds JSONC and JSON5 modes, explains each error in plain English and can auto-fix the common ones.
How can I check if a JSON file is valid online?
Upload the file with the Upload button or paste its contents, then press Validate. Files up to 10 MB are parsed in your browser; the result is either 'Valid JSON' or the location of the first error.
What is a JSON Schema validator used for?
A JSON Schema validator checks the content of a document against a schema: required fields, types, ranges and patterns. This tool checks syntax (is it JSON at all?), which is the step that comes first; a schema check only makes sense once the document parses.
How can I validate a JSON file?
Paste or upload it here, or use your runtime: node -e "JSON.parse(require('fs').readFileSync('f.json'))", python -m json.tool f.json, or jq . f.json. All of them stop at the first syntax error; this tool adds the plain-English fix.
How can I test JSON data?
First make sure it is valid JSON (this page). Then test its shape with a JSON Schema validator or your API's tests, and compare two versions with the JSON Compare tool when a payload changed unexpectedly.
How do I convert a JSON file to a readable format?
Validate it, then press Format (2) or Format (4). The output is the same data with one property per line and consistent indentation; Minify does the reverse.
What is JSON used for?
JSON (JavaScript Object Notation) is the standard text format for exchanging structured data between programs: API responses, configuration files, logs and NoSQL documents. It is readable by humans and parsed natively by every major language.
Automation: an MCP tool validate_json(text, mode) → {valid, errors[]} and an n8n node are planned for this tool.