Menu
PDF Tools
Image Tools
Converters & Utilities
Seller & Print Tools
Accounting & Business
Calculators
Text & Writing Tools
Developer & Web Tools
Creator & Social Tools
Browser Utilities & Games
Document & Design Makers
Text & Developer Tools
Exam & Form Tools

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.

How to use JSON Minifier online

  1. Paste the JSON. Type or paste the text.
  2. Choose to sort. Tick sort the keys if you want it.
  3. Read the result. The minified JSON appears with the bytes saved.
  4. 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?
No. Only the spaces outside strings are removed.
Does it work on invalid JSON?
No. It refuses and names the problem.
What is the point of sorting keys here?
It lets you compare documents or get a stable text.
Are spaces inside strings kept?
Yes, every one.
How do I make JSON readable again?
Use the JSON formatter.
Is the text I paste into the JSON Minifier uploaded?
The JSON Minifier works locally, and clearing the site data removes anything the editor saved.
How do I keep the result of the JSON Minifier?
Yes. Copy the JSON Minifier result, or press Use result as input and carry on with the new text.

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.

More tools in Text & Writing Tools →

Search tools