JSON Minifier
This tool minifies JSON by removing every space and line break that is not inside a string. It shows the bytes saved and can sort the keys.
- Free, no sign-up
- Nothing is sent to a server
- Worldwide
How to use JSON Minifier online
- Paste the JSON. Type or paste the text.
- Choose to sort. Tick sort the keys if you want it.
- Read the result. The minified JSON appears with the bytes saved.
- Copy it. Copy or save the result.
Why use this free JSON Minifier
- Removes all extra white space
- Bytes saved shown
- Optional key sorting
- Refuses invalid JSON with a message
- Strings kept exactly
- Share by link
What minifying does
Pretty-printed JSON has spaces and line breaks to make it easy to read. A computer does not need them. Minifying removes all of them, so the same data takes fewer bytes to store and send. The values are not changed, and strings keep every space they hold.
How it is done
The tool parses the text and writes it back with no extra spacing. That means invalid JSON is refused with a message that names the problem and its place, so you never get a broken result. Numbers are written in their shortest valid form, so 1.50 becomes 1.5.
A worked example
The sample document with indentation is 56 bytes. Minified, it reads {"name":"Ann","tags":["a","b"],"age":30} and is 40 bytes, a saving of 28.6%. A large document of mostly data saves less in share, since the indentation is a smaller part of it.
Sorting keys
The sort option puts the keys of every object in alphabetical order. This is handy for comparing two documents or for getting a stable text for a hash, since two objects with the same data then give the same text. It does not change lists, whose order carries meaning.
When to use it
Minify JSON for configuration sent over a network, for values stored in a database field, or for putting data in a web address. If the server compresses its responses, the gain is smaller. For reading and editing, use the JSON formatter, which does the opposite.
Using the tool
There is no button to wait for: the JSON Minifier result follows every change. Open a text file into the box, or drop one on it.
JSON Minifier: frequently asked questions
Does minifying change the data?
Does it work on invalid JSON?
What is the point of sorting keys here?
Are spaces inside strings kept?
How do I make JSON readable again?
Is the text I paste into the JSON Minifier uploaded?
How do I keep the result of the JSON Minifier?
Related searches for JSON Minifier
- JSON Minifier online
- free JSON Minifier
- JSON Minifier online free
- JSON Minifier for mobile
- JSON Minifier without sign up
- JSON Minifier – Text & Writing Tools
JSON Minifier is a free online tool on MAITBOX, in the Text & Writing Tools group. It runs in your browser, so what you type is not sent to a server. It works on Android and iPhone, and on Windows, Mac and Linux, with no download and no account.