JSON Formatter & Validator

Paste JSON below. Format it, minify it, or check whether it's valid — all in your browser.

Runs 100% in your browser. Nothing you paste here is ever sent to a server. Don't take our word for it — open your browser's DevTools (F12) → Network tab, use the tool, and watch: no new requests fire. Why that matters.

How this JSON formatter works

Paste any JSON object or array into the input box. Format / Validate pretty-prints it with 2-space indentation and tells you immediately if the JSON is malformed, including the character position of the error. Minify strips all whitespace so you can drop the JSON into a config file or API payload. Nothing you paste is uploaded anywhere — the parsing happens with JSON.parse() directly in your browser.

Common JSON errors this catches

Trailing commas, single quotes instead of double quotes, unquoted keys, missing brackets, and duplicate keys are the most frequent issues. The validator points to exactly where parsing failed so you're not scanning the whole payload by eye.

Edge cases worth knowing about

JSON doesn't support comments, so config files copied from JSON5 or JSONC (which allow // comments and trailing commas) will fail here — that's correct JSON behavior, not a bug. Numbers with leading zeros like 007 are invalid JSON. NaN and Infinity aren't valid JSON values either, even though they're valid JavaScript — if your data has these, they need to become strings or null first. Watch out for numbers larger than 2^53 (about 9 quadrillion): JavaScript's number type loses precision above that, so very large IDs (common in databases using 64-bit integers) can come back subtly wrong after a round-trip. If you have duplicate keys in an object, JSON.parse silently keeps only the last one — there's no error, so it's easy to lose data without noticing.

Frequently asked questions

Why does my JSON with comments fail to parse?

Standard JSON doesn't allow comments (// or /* */). If your file has them, it's technically JSON5 or JSONC, not JSON — strip the comments first, or use a JSON5-aware tool.

Does this preserve the original order of keys?

Yes. JavaScript object key order follows insertion order for string keys (with one exception: keys that look like non-negative integers are sorted numerically first). For typical API payloads this means your key order is preserved exactly as pasted.

Can this handle very large JSON files?

It runs entirely in your browser's memory, so very large payloads (tens of megabytes) may feel sluggish depending on your device, but there's no server-side size limit since nothing is uploaded.

Other tools