# JSON Validator

> Validate JSON online as you type. Every error gets a code, an exact line and column and a fix hint: trailing commas, single quotes, comments, NaN.

- URL: https://jsonstatham.dev/validator/
- Language: English (en)
- Russian version: https://jsonstatham.dev/ru/validator.md
- Updated: 2026-11-20

Paste JSON and the validator checks it as you type. Valid: you get the stats. Invalid: you get the code, the line, the column and what to do about it.

## How to validate JSON online

1. Paste JSON — it’s checked as you type.
2. Error? Press Show me (F8): the cursor lands on the exact character.
3. Fix it; the next check runs on its own.

## JSON validation rules (RFC 8259)

Strict JSON as RFC 8259 defines it, the same rules a JSON linter or syntax checker applies. Each problem has its own code:

- **[`trailing_comma`](https://jsonstatham.dev/errors/trailing-comma/)** — Trailing comma `[1, 2,]`
- **[`single_quotes`](https://jsonstatham.dev/errors/single-quotes/)** — Single quotes `{'a': 1}`
- **[`smart_quotes`](https://jsonstatham.dev/errors/smart-quotes/)** — Curly quotes `{“a”: 1}`
- **[`unquoted_key`](https://jsonstatham.dev/errors/unquoted-key/)** — Unquoted key `{a: 1}`
- **[`missing_comma`](https://jsonstatham.dev/errors/missing-comma/)** — Missing comma `[1 2]`
- **[`missing_colon`](https://jsonstatham.dev/errors/missing-colon/)** — Missing colon `{"a" 1}`
- **[`comment`](https://jsonstatham.dev/errors/comments/)** — Comment `// note`
- **[`invalid_literal`](https://jsonstatham.dev/errors/invalid-literal/)** — Invalid literal `True` `None` `NaN`
- **[`invalid_number`](https://jsonstatham.dev/errors/invalid-number/)** — Invalid number `01` `.5` `0x1F`
- **[`unclosed_object`](https://jsonstatham.dev/errors/unclosed-bracket/)** — Unclosed object `{"a": 1`
- **[`extra_data`](https://jsonstatham.dev/errors/extra-data/)** — Extra data after JSON `{} {}`
- **[`invalid_escape`](https://jsonstatham.dev/errors/invalid-escape/)** — Invalid escape `"C:\Users"`
- **[`bom`](https://jsonstatham.dev/errors/bom/)** — Byte order mark
- **[`control_character`](https://jsonstatham.dev/errors/control-character/)** — Control character in string

## JSON validator FAQ

### Why only one error at a time?

The first error often causes the next ones. I report the first one precisely; fix it and the check runs again as you type.

### What does the JSON linter check?

Strict JSON as defined by RFC 8259. Not allowed: trailing commas, single or curly quotes, comments, unquoted keys, NaN, Infinity, undefined, leading zeros, hex numbers, a byte order mark.

### How are lines and columns counted?

Both start at 1. A column is a Unicode code point, not a byte: a tab or a simple emoji is one column; an emoji built from several code points, such as a flag or one with a skin tone, counts each of them.

### Are duplicate keys an error?

No. RFC 8259 allows them, so the document is valid and formatting keeps both. Many parsers keep only the last one, so it’s worth avoiding them.

## Other tools

- [JSON Formatter](https://jsonstatham.dev/) — 2 spaces, 4 spaces or tabs, order kept.
- [JSON Diff](https://jsonstatham.dev/diff/) — what changed, with JSON Pointer paths.
- [JSON Viewer](https://jsonstatham.dev/viewer/) — a tree with search and a path for every node.
- [Base64 Encode & Decode](https://jsonstatham.dev/base64/) — in your browser, nothing sent.
- [JWT Decoder](https://jsonstatham.dev/jwt/) — header, payload and expiry, decoded in your browser.
- [JSON to Query String](https://jsonstatham.dev/json-to-query/) — arrays, nesting and spaces your way, and back.
- [Unicode Unescape](https://jsonstatham.dev/unicode-unescape/) — \u0430 from DevTools into letters, in your browser.
- [JSON Minifier](https://jsonstatham.dev/minifier/) — one line, every byte accounted for.
- [JSON to YAML](https://jsonstatham.dev/json-to-yaml/) — same order, same numbers, safe quoting.
- [YAML to JSON](https://jsonstatham.dev/yaml-to-json/) — numbers as written, anchors expanded, no guessing.
- [JSON Position Finder](https://jsonstatham.dev/json-position/) — turn “position 1234” into a line and column.
