Developer tools
JSON minify.
Strip every optional space and line break from a JSON document and see how many bytes you saved. Strings and numbers are left exactly as written. Invalid JSON is reported with its line and column instead of being mangled.
Your JSON
Result
What JSON minify removes
Only insignificant whitespace: the spaces, tabs and line breaks between tokens that RFC 8259, The JSON Data Interchange Format (December 2017) (section 2) allows around the structural characters. Whitespace inside a string is data and stays. Because the parser checks the document first, you also learn immediately if the input was not valid JSON to begin with, which a plain find-and-replace minifier would never tell you.
How the saving is measured
The Input size and Minified size figures are UTF-8 byte counts, which is what a file or an HTTP body actually costs, not the number of characters. The percentage saved depends on how heavily your original was indented, so a pretty-printed file with deep nesting shrinks far more than one that was already compact. The tool shows the real figure for your input.
Big numbers and duplicate keys are flagged, not changed
Most tools run JSON.parse and then JSON.stringify, which silently turns 9007199254740993 into 9007199254740992 and drops all but the last copy of a repeated key. This page keeps every number and string exactly as you wrote it. When a number has more precision than an IEEE 754 double can hold, as JavaScript numbers do, it gets a warning, because RFC 8259, The JSON Data Interchange Format (December 2017) (section 6) says software that expects no more than that precision interoperates best. Repeated property names get a warning with the line and column, because section 4 says names should be unique and that many parsers keep only the last one.
Minify, then compress
Minifying and transport compression are separate steps that stack. Minify here when you are embedding JSON in a page, a config bundle or a payload where every byte is stored or counted; the result is still valid JSON and parses to the same data.
Common JSON errors and how to fix them
- Trailing comma after the last item, as in
[1, 2,]. The grammar only allows a comma between two values. Delete it. - Single quotes or unquoted property names. JSON needs
"name"in double quotes; JavaScript object literals are more relaxed than JSON. - Comments (
//or/* */). JSON has no comment syntax. - Leading zeros such as
007, a leading+, or a bare.5. Write7and0.5, or quote an ID that needs its zeros. NaN,Infinityandundefined. None is a JSON value; usenullor a string.- Raw line breaks inside a string. Write
\ninstead; control characters below U+0020 must be escaped.
Frequently asked questions
Does minifying change my data?
No. Only whitespace outside strings is removed. Every key, string, number, true, false and null is written back exactly as you typed it, in the same order unless you tick Sort keys.
Is minified JSON still valid JSON?
Yes. The grammar makes whitespace between tokens optional, so a document with none parses to the same value as the indented one.
Can I minify JSON that contains comments?
Not as JSON. Comments are not part of the JSON grammar, so the tool reports the position of the comment as an error. Remove the comment first, or use a JSON5 or JSONC tool if that is the format you really have.
Is my JSON sent to a server to be minified?
No. The work is done by JavaScript in your browser tab and the text never leaves your device.
Sources
RFC 8259, The JSON Data Interchange Format (December 2017); ECMA-404, The JSON Data Interchange Syntax. All retrieved 2026-10. Parsing and formatting run entirely in your browser; this tool does not check your JSON against a schema or verify what the values mean.