elefcode

JSON tool

JSON Validator — free online tool

Paste any JSON to check that it's valid — get the line, column and a plain-English reason for the first error, and one-click repair for the common mistakes.

What does this do?

Bad JSON is one of the most common bugs in development: a stray trailing comma, a single-quoted string, a missing quote around a key. This validator points at the exact line and column, shows the offending line with a caret, and explains the problem in plain words. "Repair" re-parses the text with a forgiving parser — not search-and-replace — so URLs containing `//` and apostrophes inside strings are left alone. It fixes trailing and missing commas, `//` and `/* */` comments, single quotes, unquoted keys, Python `True`/`False`/`None`, `NaN`, hex numbers, unclosed brackets, JSON Lines and JSONP wrappers. It also warns about duplicate keys and about numbers too large for JavaScript to hold exactly.

When to use it

  • ▸Debug a JSON payload an API rejected
  • ▸Validate `tsconfig.json`, `settings.json`, or other JSONC
  • ▸Check a JSON Lines file before importing it
  • ▸Auto-clean JavaScript-style object literals into valid JSON

Tip

A valid JSON document is exactly one value: object, array, string, number, boolean, or null. Strings must use double quotes. Keys must be quoted. Trailing commas, single quotes, and comments are not allowed — Repair fixes all of them. For files that are meant to have comments, such as tsconfig.json, switch on JSONC to format them with the comments kept.

Example: JavaScript-style object → valid JSON

Input — JSON

{
  // A typical eslint config — not valid JSON, but Repair fixes it
  rules: {
    'no-unused-vars': 'warn',
    'no-console': 'off',
  },
  extends: ['plugin:react/recommended'],
}

Output

{
  "rules": {
    "no-unused-vars": "warn",
    "no-console": "off"
  },
  "extends": [
    "plugin:react/recommended"
  ]
}

More JSON tools