Skip to content

JSON Validator

Paste a payload to see whether it is valid JSON. Errors show the line and column — not just “unexpected token”. Validation runs as you type in the browser.

Loading tool…

How to use JSON Validator

  1. 1. Paste or open a file. The validator runs on every edit. Invalid documents show a red error under the input.
  2. 2. Read line and column. Fix the reported position — trailing commas and single quotes are the usual suspects.
  3. 3. Repair if needed. Click Repair to fix common JSON5-style mistakes, then validate again.

About this tool

“JSON validator online” is a different intent from “formatter”: people often have a broken config or API response and need to know why parse fails. This page emphasizes validation with actionable error locations.

Strict JSON rules

JSON requires double-quoted keys and strings, no trailing commas, no comments, and no undefined. JavaScript object literals are not JSON — that mismatch causes most validation failures.

Validation is not schema checking

This tool checks syntax only. A document can be valid JSON but wrong for your API. Use JSON Schema in your tests or the JSON to TypeScript tool for shape checks.

Code examples

JavaScript

const payload = JSON.parse(raw);
console.log(JSON.stringify(payload, null, 2));

Python

import json
print(json.dumps(json.loads(raw), indent=2, sort_keys=True))

Go

var buf bytes.Buffer
if err := json.Indent(&buf, []byte(raw), "", "  "); err != nil {
  log.Fatal(err)
}

This is one direction of the shared converter. The editor is the same; the title and default direction match this search.

Frequently asked questions

Related tools

All tools