Skip to content

JSON Formatter & Validator

Pretty-print, minify, and validate JSON with helpful error details.

About the JSON Formatter

JSON (JavaScript Object Notation) is the dominant data format for web APIs, config files, and inter-service communication. Real-world JSON often arrives on one massive line, with escaped quotes, or simply malformed — making it nearly impossible to read or debug. This tool fixes that.

Paste any JSON and get it pretty-printed with two-space indentation, fully validated, and ready to copy back into your editor, API client, or terminal. If it isn't valid, you'll see exactly where the parser failed.

How it works

Formatting uses the browser's built-in JSON.parse and JSON.stringify, which conform to the ECMA-404 standard. The validator reports the position and reason for the first parse error (for example, Unexpected token ',' at position 142) so you can jump straight to it.

Minify mode strips all whitespace to produce the smallest valid representation, which is useful when you need to embed JSON in a URL, an environment variable, or a size-sensitive config field.

Privacy

Your JSON is parsed entirely in your browser. We never see your data, even if it contains API keys, customer records, or other sensitive information. Always rotate credentials that you paste into any online tool, just in case.

Frequently asked questions

What's the difference between JSON and JSON5 / JSONC?
Standard JSON disallows comments, trailing commas, and unquoted keys. JSON5 and JSONC (used by VS Code) allow them for readability. This tool follows strict JSON (ECMA-404); paste-with-comments may fail validation.
How do I fix 'Unexpected token' errors?
Look at the line and column number reported in the error. The most common causes are a missing comma between properties, a stray trailing comma after the last item, an unescaped quote inside a string, or single quotes used instead of double quotes.
Can I format JSON nested inside a string?
If a value is itself a JSON-encoded string, copy that string's content, unescape the quotes, and paste it as fresh input to format it.
Is there a size limit?
Practical limit is whatever your browser tab can hold in memory — typically tens of megabytes. Very large files (100MB+) may take a noticeable moment to format on a slower device.
Does this support JSON Schema validation?
Not yet — the validator confirms syntactic correctness (parseable JSON), not whether the data matches a schema. JSON Schema validation is on the roadmap.

Other free utilities that pair well with this one.