Cookies for analytics and advertising
We use cookies for analytics and advertising, both sent to Google. Refusing changes nothing you can see.Read the privacy page
Paste JSON and get the same data with every removable space gone, along with what that actually saved. The saving is measured in bytes rather than characters, because a document is transferred as UTF-8 and for anything containing CJK or emoji the two numbers differ by a factor of three.
Where it runs
Nothing is uploaded, because there is no file — it is worked out in this page.
No queue, no account
It answers as fast as your machine can, and it never asks who you are.
As often as you like
Nothing is counted and nothing is capped — answering again costs us nothing.
Whitespace between tokens is meaningless and whitespace inside a string is data. A minifier that removes every space it finds will turn a name, an address or a sentence stored as a value into something else, and the result is still valid JSON — so nothing downstream complains, and the corruption is discovered by a person reading it much later.
This one parses the document and prints it without indentation, which cannot make that mistake by construction. It is also why it refuses input that does not parse: there is no partial understanding to fall back on.
Formatted JSON is typically twenty to forty per cent whitespace, so the number here looks impressive. Over a network it mostly is not, because responses are compressed and gzip is extremely good at runs of spaces — the compressed difference between formatted and minified JSON is often under five per cent.
Where it does count is anywhere compression is not in play: a value in an environment variable, a column in a database, a single line in a log, a field with a hard length limit, a QR code. Those are the reasons this page exists, and in every one of them the raw byte count is the constraint.
A character count is what a text box gives you and it is the wrong measure. JSON travels as UTF-8, where an ASCII character takes one byte, an accented Latin or Cyrillic character two, most CJK three, and an emoji four. A document of a thousand Japanese characters is roughly three thousand bytes.
Every real limit — a header size, a column width, a message size on a queue — is in bytes. Measuring in characters means a document that fits by your count and is rejected by theirs, which is a confusing failure precisely because the number you checked was fine.
Do it for anything stored or transmitted where compression is absent and size is bounded. Do it for a payload you are about to paste into a form field, a CI variable or a Kubernetes secret. Do it for a document that has to be one line because something downstream reads line by line.
Do not do it to a file that lives in a repository. A minified config is a config nobody can review: every change touches the single line it consists of, so the diff shows the whole file and a reviewer sees nothing. The bytes saved are irrelevant next to that, and the build step that would minify it on the way out already exists.
Not much, and that is the point of knowing where the floor is. Minified JSON still spends bytes on quotation marks around every key, on the key names themselves repeated in every record of an array, and on the punctuation between them. For a list of a thousand objects with the same four fields, the field names are most of the file.
If minifying is not enough, the next steps are structural rather than cosmetic: shorter key names, an array of arrays with the field names stated once, or a format that is not JSON. That is a decision about the interface, not about whitespace, and it is worth recognising which of the two you are actually in.
Usually less than the number here suggests. Responses are normally compressed, and gzip handles runs of spaces extremely well — the compressed difference between formatted and minified JSON is often under five per cent. The saving is real where compression is absent: an environment variable, a database column, a log line, a QR code.
Because every real limit is in bytes. JSON travels as UTF-8, so a CJK character costs three bytes and an emoji four. A document that fits by character count and is rejected by a byte limit is a confusing failure, and it is confusing precisely because the number you checked was fine.
No. It parses the document and prints it without indentation, so whitespace inside a value is data and is untouched. Minifiers that work on the text instead do break exactly that, and the result is still valid JSON — so nothing complains, and a person finds the corrupted name much later.
Almost never. A minified file is one line, so every change shows the whole file as modified and a reviewer sees nothing. Keep it readable in the repository and minify in the build step, which is where the constraint actually applies.
No. It is parsed and reprinted in this page and never leaves your device. What gets pasted into a minifier is usually a payload from a system somebody works on, which is exactly the category that should not be travelling to a third party to have its spaces removed.