Local JSON tool
JSON Minifier
Minify removes insignificant whitespace so a JSON value fits on one line. It does not shorten keys, and it does not change what the value means. This page starts on Minify.
Runs in your browser. JSON is not uploaded. Privacy policy
What insignificant whitespace means
Spaces, tabs, and line breaks between tokens can go. Spaces inside a string are part of the string and stay. The reprint is JSON.stringify with no indent argument, which is the compact form the extension produces. A colon has no space after it in that form, and a comma has no space after it either. The result is one line because there are no line breaks left outside strings.
{
"active": true,
"id": 1
}That value minifies to {"active":true,"id":1}. The key order is unchanged. true is still a boolean, and 1 is still a number. If you beautify the one-line result, you get the two-space form back. Minify and the JSON beautifier are inverse reprints of a valid value, not two different parsers.
When a single line is the point
Some fields, query parameters, and log lines cannot hold a newline. A pretty-printed body would either break the field or smuggle a line break into a place that treats it as a separator. Minify first, then paste. Do this after you are sure the shape is right. A one-line payload is harder to review, so use the JSON formatter or the JSON viewer while you are still reading, and minify as the last step.
Minify is not compression. It does not gzip, and it does not rename keys to one letter. The character count can drop a lot when the input was indented, and it drops almost not at all when the input was already compact. The validator’s character count is available if you want the length of the current input; the minified length is the length of the result. Neither number is the size on the wire after HTTP compression.
What minify refuses
Invalid JSON is not partially minified. A trailing comma, a comment, or a second value stops the run and reports the line and column. Fix it with the JSON validator, then minify. Empty input stays empty. The tool will not emit {} as a stand-in for a blank box.
Characters that JSON must escape, such as a quote or a backslash inside a string, remain escaped in the one-line result. Characters that JSON.stringify leaves as themselves, including ordinary non-ASCII letters, stay as themselves. You get standard JSON, not a custom encoding. Search still works if you switch to Tree view: it filters the parsed value, not the minified line.
Order of operations
- Validate or beautify so you can see the shape.
- Confirm key order and types. Minify will not fix a string that should have been a number.
- Minify, then copy the one line.
- If the destination rejects it, the problem is almost never the missing spaces. Validate the original again.
Questions
Will minify break my strings?
Spaces, newlines, and quotes that are inside strings stay part of the string, with the escapes JSON requires. Only whitespace between values is removed.
Does minify sort keys or drop null?
No. Null stays null, and keys stay in the order they parsed. Dropping null would change the document for any API that treats a missing key and a null key differently.
Why is the minified text still long?
The payload is long. Minify only removes insignificant whitespace. It is not a compressor and it does not abbreviate keys.
Is the one-line result uploaded?
No. The reprint is produced in the tab. Copy writes to your clipboard. The site has no field that submits the JSON.