OTK OneTabKit
{ }

JSON Formatter

Format, minify, and validate JSON — errors are pinpointed for you.

Input

Output

Paste or type JSON on the left to get started.

Valid JSON is stricter than it looks

JavaScript object syntax and JSON look almost identical, which is exactly what causes most validation errors. Paste {name: 'Alex', age: 30,} — valid-looking JavaScript, with an unquoted key, single quotes, and a trailing comma — and this tool reports "Invalid JSON — Expected property name or '}' in JSON at position 1." JSON requires double-quoted keys and string values, doesn't allow single quotes at all, and doesn't allow a trailing comma after the last item. The corrected version, {"name": "Alex", "age": 30}, is valid. All three of those differences are the most common reasons hand-written or copy-pasted JSON fails to validate.

What minifying actually saves

Take a small formatted object — four fields, one nested array — at 95 characters with standard 2-space indentation. Minified, the exact same data is 65 characters: a 32% reduction, purely from removing whitespace and line breaks that don't carry any meaning to a JSON parser. That reduction compounds at scale — an API response or config file with thousands of similar objects sees the same percentage savings, which is why minified JSON is the default for anything sent over a network, while formatted JSON is what you actually want on screen while debugging.

Frequently Asked Questions

It removes all unnecessary whitespace and line breaks, producing the smallest possible valid JSON — useful for reducing file size in production.

Common causes are trailing commas, single quotes instead of double quotes, or missing brackets — the error message points to roughly where the problem is.

No — formatting and validation happen entirely in your browser. Nothing you paste here is transmitted anywhere.