JSON Minifier - Minify and Compress JSON Online
Paste formatted JSON and get the smallest valid version on one line, ready to embed in code, send in a request or store. The status line shows the size before and after.
How to minify JSON
- Paste formatted JSON into the left editor, or open or drop a .json file.
- The minified JSON appears on the right, on a single line. The status line shows the size before and after, and how much smaller it is.
- Copy the result or download it as a .json file.
What minifying removes
Minifying removes every space, tab and line break that sits between values. It does not touch the data itself: strings, numbers, keys and their order stay exactly as they were, and spaces inside strings are kept. The output parses to the same value as the input.
The input has to be valid JSON. If it is not, the error is shown with its line and column. For input with comments, trailing commas or single quotes, run it through the JSON Repair tool first.
Why minify JSON?
- Smaller payloads. Indentation can account for a quarter or more of a JSON file. Minified JSON loads faster and costs less bandwidth and storage.
- One line. A single line is easier to put in an environment variable, a command-line argument, a CSV cell, a log entry or a test fixture.
- Consistent output. Minifying gives the same text for the same data however it was formatted, which helps when you hash or sign JSON.
If you are serving JSON over HTTP, gzip or Brotli compression saves even more, and works well together with minifying.
Example
{
"name": "online-json",
"tools": [ "formatter", "minifier" ]
}
becomes {"name":"online-json","tools":["formatter","minifier"]}.
To make minified JSON readable again, paste it into the JSON Beautifier.
Private by design
Minifying happens in your browser. Your JSON is never uploaded.