Skip to content

JSON Validator

Check whether your JSON is valid and find the error.

How to use the JSON validator

Three steps, all in your browser.

  1. 1

    Paste your input

    Type or paste your code or data. Press Sample to try an example.

  2. 2

    Pick the style

    Choose indentation or options. The result updates as you type.

  3. 3

    Copy the result

    Copy the output in one click. Nothing is saved or sent anywhere.

JSON Validator: what to know

The JSON validator tells you straight away whether your text is valid JSON and, if not, where the first error is. It uses a strict parser that follows the JSON grammar from RFC 8259 and ECMA-404, reporting the line and column of the first error, so anything it accepts will parse in any standards-compliant library, including JSON.parse.

Most invalid JSON comes from a short list of mistakes: a comma after the last item in an object or array, strings or keys in single quotes, keys without quotes, comments, special values such as NaN, Infinity or undefined, and raw control characters such as a tab or newline inside a string, which must be written as \t or \n. JavaScript object literals allow several of these, which is why copying an object from code often fails.

This checks syntax only. Whether the data has the fields and types your application expects is a separate question, answered by a JSON Schema validator or by type checks in your code.

Popular uses

  • Finding why an API rejects a request body
  • Checking a package.json or tsconfig after hand edits
  • Validating JSON copied from documentation or chat
  • Confirming a generated file is well-formed before deploying

Tips for the best result

  • Fix errors one at a time from the top: a single missing quote can make the parser report a problem further down.
  • Smart quotes (“like these”) pasted from a document or chat app aren't valid JSON quotes; replace them with straight double quotes.
  • tsconfig.json and VS Code settings allow comments (JSONC), so they can be valid for their tools and still fail strict JSON validation.

Read how JustYourDev works and our privacy details. Code, data and files you use here are processed in your browser and are never sent to our server.

Frequently asked questions

Anything outside the JSON grammar in RFC 8259: trailing commas, single-quoted strings, unquoted keys, comments, NaN or Infinity, undefined, and unescaped control characters such as a raw tab inside a string.

No. It checks syntax, that the text is well-formed JSON. Checking that the data has the right fields and types needs a JSON Schema validator in your code or test suite.

The JSON standard says keys should be unique but doesn't forbid duplicates, and most parsers, including the one in your browser, quietly keep the last value. Avoid them: different systems handle them differently.

No. Every tool runs in your browser, so your code, tokens, keys and files are processed on your device and are not sent to our server or stored. Reloading or closing the page clears them.

Yes. Every tool is free with no sign-up and no limits on use. Clearly labeled ads keep it that way.

Yes. The tools work in any modern browser on phones, tablets and computers, though large files and long code are easier to handle on a computer.