AltUtils

JSON Formatter

Format, validate, minify and explore JSON with precise error locations. Your data never leaves the browser.

CategoryDev Core
Sheet08 / 42
ProcessingIn your browser

What is the JSON Formatter & Validator?

This JSON Formatter and Validator pretty-prints, minifies and checks JSON (RFC 8259) directly in your browser. Paste a document or drop a file, choose 2 spaces, 4 spaces or tabs, optionally sort object keys alphabetically, and copy or download the result. A collapsible tree view lets you explore large payloads and copy the JSONPath of any value with one click.

When the JSON is invalid, the validator reports what went wrong together with the exact line and column, shows the offending line with a caret, and can jump to the error in the editor. It also warns about problems that standard parsers accept silently: duplicate keys (where only the last value survives) and integers larger than 2^53 that JavaScript would round.

Formatting is lossless: numbers and string escapes are written exactly as they appear in the source, so IDs like 12345678901234567890 are not rounded and key order is preserved unless you choose to sort. The optional Fix JSON action repairs common almost-JSON — comments, trailing or missing commas, single quotes, unquoted keys, Python True/False/None, NaN, JSONP wrappers and unclosed brackets — and shows exactly what it changed, with one-click undo. Nothing is uploaded; multi-megabyte files are processed locally.

Frequently asked questions

What is JSON used for?
JSON (JavaScript Object Notation) is the most common format for exchanging data between web servers, APIs and applications, and for configuration files. It is text-based, language-independent and easy for both humans and machines to read.
Why is my JSON invalid?
The most common causes are trailing commas, single quotes instead of double quotes, unquoted property names, comments, unescaped line breaks inside strings and missing brackets. The validator shows the exact line and column of the first error, and Fix JSON can repair most of these automatically.
What does Fix JSON change?
It removes comments and trailing commas, inserts missing commas and colons, converts single-quoted or unquoted strings and keys to double-quoted ones, maps True/False/None/NaN/undefined to JSON literals, closes unterminated strings and brackets, and wraps several top-level values (such as NDJSON) in an array. Every change is listed and can be undone.
What does Minify do?
Minifying removes all optional whitespace and line breaks, producing the smallest equivalent JSON. It reduces payload size for APIs and storage; the data itself is unchanged.
Will formatting change my numbers?
No. Unlike tools built on JSON.parse and JSON.stringify, this formatter keeps every number literal as written, so large integers, trailing zeros like 9.50 and exponents like 1E+5 are preserved, as are string escape sequences.
Is my JSON sent to a server?
No. Parsing, validation, repair and formatting all run locally in your browser, so API responses, tokens and personal data never leave your device.
Can it handle large JSON files?
Yes. Documents of several megabytes are typically parsed and formatted in a fraction of a second on a modern laptop, the results are recomputed at low priority while you type, and the tree view renders large arrays in chunks so the page does not freeze.