jfmt.dev

JSON Validator

Paste a payload to check that it parses as JSON. A valid document is confirmed in this tab; an invalid one shows the syntax problem next to the editor. Nothing is posted to a server.

input.json

JSON formatter

Input0 B
Output ยท preview.json
{ }

Run a tool to see a polished result here

Live syncReady ยท processed locally in your browser
Local-only processing: your JSON never leaves this browser tab.

Syntax validation, not schema validation

This page asks โ€œis this JSON?โ€ โ€” commas, quotes, brackets, and literal names. It does not evaluate JSON Schema, OpenAPI, or TypeScript types. A document can be valid JSON and still be the wrong shape for your API. Use Repair when the text is JavaScript-like (comments, trailing commas, single quotes) rather than strict JSON.

Errors this validator is meant to catch

Missing commas between members. Extra commas after the last array item or object property. Single-quoted strings (`'name'`). Unquoted keys (`{name: 1}`). Bare `NaN`, `Infinity`, or `undefined`. JavaScript comments. Truncated files that close fewer braces than they open. Those are all syntax problems; the status line is the place to read them.

{ name: 'jfmt', tags: ['json',], }  โ† not JSON
{ "name": "jfmt", "tags": ["json"] } โ† valid

Duplicate keys and oversized integers

Standard JSON.parse keeps the last duplicate key and ignores the earlier ones. JFmt still parses, then warns in the summary when a key appeared more than once so silent data loss is visible. Integers above Number.MAX_SAFE_INTEGER are preserved as digits in the formatted output rather than rounded.

Valid JSON that is still the wrong document

The validator will accept `"null"`, `[]`, and `{"status": 500}` because they parse. It will not tell you that an order is missing `items` or that `price` should be a number. Pair this page with JSONPath or JSON Compare when you need shape or drift checks on top of syntax.

Sample input on this page

The sample is already valid: an envelope with ok, errors, and a nested payload. Break it on purpose (delete a comma, add a trailing comma, wrap a key in single quotes) to see how each class of error is reported.

{
  "ok": true,
  "errors": [],
  "payload": { "id": 42, "name": "jfmt" }
}

How to use this tool

  1. Paste the candidate text. Logs, LLM output, and copy-paste from JavaScript objects are the usual failures.
  2. Run JSON Validator. Success formats the value and reports duplicate keys if the parser saw them. Failure names the unexpected token so you can fix the source.
  3. If the only issues are trailing commas or comments, switch to Repair instead of editing by hand.
  4. After it validates, you can beautify, view a tree, or convert โ€” validation does not upload the payload at any step.

When this page is the right choice

Use the validator when a parser elsewhere rejected a file and you need the syntax error locally. Skip this page if you already know the JSON is valid and you want a tree, a spreadsheet, or a compare report.

FAQ

Does validation upload my file?

No. Parsing runs in a Web Worker in this tab.

Can the validator fix invalid JSON?

No. This URL starts in validate-only mode. Switch to Repair in the sidebar for automatic syntax fixes.

Are duplicate keys reported?

Yes, in the status summary when the parser sees them. JSON objects should have unique keys; the last value wins.

Is this JSON Schema / jsonlint?

It is a syntax checker (jsonlint-style). It does not load a JSON Schema and does not check types beyond JSON literals.

Why did `undefined` fail?

JSON has null, not undefined. Replace undefined with null or omit the key.