Skip to main content
CodeLint.Dev Dev Tools

JSON Tools — Format, Validate, Minify & Escape

Three JSON tools that cover the whole round trip — make it readable, make it small, make it safe to embed in a string.

3 tools · Reviewed by Mimamsa, Founder & Engineer, CodeLint.Dev

JSON looks forgiving and is not. RFC 8259 defines exactly six value types, forbids comments and trailing commas, requires double-quoted keys, and rejects leading zeros in numbers. Most of the time you discover a violation as a parse error thrown three layers deep in someone else’s library, with a byte offset instead of a line number.

These three tools split that problem up. The formatter and validator is where you paste something that will not parse: it reports every violation with a line and column, then re-indents the document once it is clean. The minifier goes the other way, stripping insignificant whitespace for payloads that travel over a network. The escaper handles the case where the JSON has to survive being embedded inside another JSON string — the double-encoding that turns a config file into an unreadable wall of backslashes.

All three run as JavaScript in your own browser. Nothing you paste is uploaded, which is the point: the JSON worth debugging usually contains an access token, a customer record, or an internal hostname.

JSON tools

Which JSON tool do I need?

Pick by the symptom rather than the operation:

If you are…UseBecause
Getting a parse error you cannot locateFormatter & ValidatorReports the exact line and column of every violation, not just the first byte offset
Reading an unformatted API responseFormatter & ValidatorRe-indents consistently and pretty-prints nested structures into a readable tree
Diffing two config files that keep showing false changesFormatter & Validator, with Sort Keys onObject key order is not significant in JSON but is significant to a line-based diff
Shrinking a payload before it goes over the wireMinifierRemoves every byte that a parser ignores, without touching string contents
Embedding JSON inside a JSON string fieldEscape / UnescapeRaw quotes and newlines break the outer document; escaping makes the inner one a valid string
Staring at a wall of \" and \\ in a log lineEscape / Unescape, in the Unescape directionReverses double-encoding so the original document becomes readable again

In-depth guides

Long-form articles covering the standards and formulas behind these tools.

Frequently asked questions

Is my JSON uploaded to a server?
No. All three tools are JavaScript that runs in your browser. Nothing you paste leaves your device, so it is safe to work with API responses, tokens, and database exports. Once a page has loaded it also keeps working with the network disconnected.
Why does my JSON fail validation when it works in JavaScript?
JavaScript object literals are a superset of JSON. Trailing commas, single-quoted strings, unquoted keys, comments, NaN and Infinity are all legal JavaScript and all invalid JSON. If a document parses with eval() but fails JSON.parse(), one of those is the reason.
What is the largest document these tools handle?
They are limited by your browser tab’s memory rather than an upload cap. Documents in the low tens of megabytes format without trouble on a normal machine; past that the editor’s syntax highlighting, rather than the parsing, becomes the bottleneck.

Other tool categories