JSON formatter and validator

Catch syntax errors, clean up API responses, and switch between readable and compact JSON without leaving the browser.

Mode:
Indent:
Input JSON
Object or array
Result preview

JSON formatting and validation

JSON is the format people end up staring at when an API response, config file, webhook, or static data feed stops behaving. A good formatter should make the structure obvious, keep the data unchanged, and point to the exact syntax issue instead of leaving you to scan a thousand characters by eye.

Pretty mode

Expand compact JSON into a readable tree so nested objects, arrays, and repeated fields can be reviewed without losing the original data.

Minify mode

Remove whitespace and line breaks when you need a compact payload for fixtures, embeds, static files, or quick transfer.

Parser feedback

Catch invalid quotes, dangling commas, missing brackets, and broken escape sequences before the payload reaches code, CI, or a third-party integration.

Common JSON errors

Error typeWhat usually causes itExample
Unexpected tokenTrailing commas, single quotes, comments, or malformed escape characters often trigger this error.{ "key": "value", }
Unexpected end of inputAn object or array was not closed properly.{ "data": [1, 2
Unquoted keyJSON requires double quotes around every property name.{ key: "value" }

Frequently asked questions

Does standard JSON allow comments?

No. RFC 8259 JSON does not support comments. If you need inline notes, use another format such as YAML or JSON5, or add a dedicated field like _comment.

Can I use single quotes in JSON?

No. JSON requires double quotes around both property names and string values. Single quotes are allowed in JavaScript object literals, but not in strict JSON.

Does formatting change the JSON data?

No. Pretty printing only changes whitespace and indentation. Minifying removes that whitespace again. The object values should stay the same unless the original input is invalid.

Why does a JavaScript object work but fail as JSON?

JavaScript object literals allow conveniences such as unquoted keys, comments, functions, undefined values, and trailing commas in some contexts. Strict JSON is a data format, so it accepts a smaller and more portable syntax.