JSON
Validate, pretty-print, and minify JSON entirely in your browser.
{
"name": "renderhub",
"type": "ssg",
"features": [
"preview",
"edit",
"download"
],
"ads": {
"provider": "adsense",
"enabled": true
}
}Tools
- Format — pretty-print with chosen indent.
- Minify — strip whitespace.
- Errors show inline on the right pane.
What is JSON, and what is this tool for?
JSON (JavaScript Object Notation) is the most common text format for moving structured data between systems — APIs, configuration files, log records, message queues. It is intentionally small: six value types (object, array, string, number, boolean, null) and a strict grammar that maps cleanly to almost every programming language. This page validates, formats, and minifies JSON in your browser, with errors reported as you type.
The errors you will actually see
- Trailing commas — perfectly valid JavaScript, illegal in JSON. The parser rejects
[1, 2, 3,]and{"a": 1,}. - Single quotes — JSON strings must use double quotes. Output from a Python repr or a careless copy from JavaScript often uses
'. - Unquoted keys —
{name: "ada"}is a JavaScript object literal, not JSON. Keys must always be quoted strings. - Comments — JSON proper has no comment syntax. If your config allows
//or/* */, it is JSON5 or JSONC, not JSON. - NaN, Infinity, undefined — these are JavaScript values, not JSON values. A number that fails to round-trip is usually one of these.
Format vs minify
Format pretty-prints with the indent you choose — useful when reviewing API responses or committing fixtures to source control. Minify strips all insignificant whitespace, producing the most compact representation; this is what you want before storing JSON in a database column, embedding it in a URL, or comparing the size of two payloads.
JSON vs JSON5 vs JSONC
If you maintain configuration files, you will run into JSON5 (trailing commas, single quotes, comments, unquoted keys) and JSONC (JSON with comments — used by VS Code and TypeScript tsconfig.json). Both are supersets: they accept everything valid JSON does, but valid JSON5 or JSONC is not necessarily valid JSON. When in doubt, run it through this tool — if it parses cleanly here, it is portable JSON.