UTILITIES NEWBIE

Digital tools

JSON minifier

Create a compact JSON representation without removing spaces that belong inside string values.

Input

Import a local text file

0 UTF-16 code units

Optional local draft

Saving stores a plaintext draft in this browser on this device. Do not save secrets or use this on a shared device. Nothing is saved or loaded automatically. Reset does not delete a saved draft; use Delete local draft.

No draft has been loaded.

Output

Keep values while compacting. Full explanation follows.
Name stays Ada. Text explanation

The synthetic record keeps the name Ada, the ordered scores array containing three and five, and an active boolean set to true. Compaction changes layout between tokens, not the space content of a string. The exact input and result are given in the worked example below.

Prepare a compact JSON handoff without hiding changes

Choose the right operation

The JSON Minifier takes one complete JSON value and returns a compact serialization of its decoded value. Paste a synthetic document into the input and choose Minify JSON. The result removes layout whitespace between tokens while retaining meaningful characters inside strings. This is useful when a destination wants a concise payload, but it is not a compression archive, a security filter or a promise to preserve the original text byte for byte.

Start by checking that the source really is JSON. Object keys and string values need double quotes, and comments or trailing commas are not accepted by this page. A JavaScript object literal may look similar while using different syntax. The minifier does not execute JavaScript, interpret expressions or automatically switch formats. Use an appropriate existing converter when the source is XML or another data format rather than relabeling it as JSON.

A valid source can be an object, an array or a supported scalar such as a string, number, boolean or null. The operation is not limited to a list of records. What matters is that the entire input describes one value under the tool's strict parser. Extra text after that value is an error. Two adjacent documents need an explicit data-model decision before they can become one request.

Keep an untouched original when textual spelling matters. Parsing and serialization can change how numbers and escapes are written even when their decoded meaning is retained. The minifier is not a canonicalization specification or a signature-preserving editor. If another system verifies a hash or signature over the original bytes, replacing those bytes with the result can invalidate that check. Confirm the receiving contract before substituting the compact output.

Follow a small record into its output

Checked synthetic input

{ "name": "Ada", "scores": [3, 5], "active": true }

Exact observed output

{"name":"Ada","scores":[3,5],"active":true}

Use a synthetic object with a name of Ada, a scores array containing three and five, and an active flag set to true. Add ordinary spaces around its separators to make the formatting change visible. The compact result retains the same fields and array order, with no layout spaces between the tokens. The educational figure shows the value fields alongside the compact result; it does not represent a transfer to another service.

The space inside a string is different from layout whitespace. A name or note containing two words must keep the separating space as part of its value. Removing every whitespace character with a general text replacement would corrupt that content. This page parses the structure before writing the result, so the correct test is whether the decoded values agree, not whether every visible space disappeared.

Try a second synthetic record containing a number written with a fractional zero, an exponent and negative zero. The serializer may write those values in a normalized numeric spelling. An escaped letter can similarly be written as its decoded character. Those transformations explain why the output can be useful JSON without being an exact textual copy. They are not evidence that the tool preserved numeric source notation or every escape sequence.

Review the actual result before handing it off. Check the name, both array elements and the boolean type, then copy the output. Download output creates a text payload with the tool's chosen extension; the contents are the result, not a full report containing the source and all warnings. A successful button action alone is not proof of what a receiving application stored, so verify the delivered text when that distinction matters.

Understand strict parsing and finite limits

The implementation rejects duplicate object keys, including differently escaped names that decode to the same key. This avoids silently choosing one repeated field. Treat the rejection as a prompt to inspect the source, not as permission to delete a field arbitrarily. Two duplicate entries may reveal a source-generation problem whose intended value cannot be determined from syntax alone.

The parser also rejects nonfinite numbers and numeric integers outside JavaScript's safe-integer range. Large identifiers should be quoted as text when that matches their intended data type, rather than forced into a number and allowed to lose digits. Ordinary fractional numbers still follow JavaScript numeric behavior. The minifier is not an exact decimal accounting engine, and acceptance does not certify arbitrary numeric precision.

Input is limited to one hundred thousand UTF-16 code units. The parser permits at most ten thousand values and forty nesting levels, while generated output has a one-million-character ceiling. These are actual implementation boundaries, not a recommended payload size for every browser. The local processor also has startup and processing deadlines. A failure or cancellation is not a completed compact result, and a smaller or simpler fixture may be needed for diagnosis.

The optional text import has a separate one-hundred-thousand-byte file limit. Bytes and UTF-16 code units are different measurements, especially for non-ASCII text. A file extension does not establish that its contents are valid JSON. Loading a file only supplies text to the workflow; the same strict parse and operation still need to succeed before the result should be used.

Optional local drafts are explicit plaintext browser storage on this device. Do not save secrets or use that feature casually on a shared computer. Nothing is automatically saved or loaded by those controls. Reset does not delete a saved draft; its dedicated deletion control is separate. These practical storage facts are not a claim that the whole website has no network activity or no other privacy disclosures.

Use the compact document for a defined purpose

A practical use is preparing a small known fixture for an application that accepts JSON without presentation indentation. Keep the original and compact forms separately until the destination has accepted the intended values. The page does not submit an API request, authenticate to another service or validate that service's field requirements. Compact formatting is only one step in the handoff.

Another use is comparing how two tools handle strings and numeric spelling. Include a space inside a string and a deliberately chosen numeric notation, then inspect both decoded values and the resulting text. That small experiment is more informative than assuming that a shorter document must be equivalent in every relevant sense. Arrays retain their order, while original object-member text order is not a general preservation guarantee.

Do not use minification as anonymization. Names, identifiers and other values remain present in the output. Replacing a few visible fields with synthetic data is a separate preparation task that needs its own review. The converter does not decide which information is sensitive or remove it automatically. A compact payload can contain exactly the same confidential meaning as an indented one.

If the destination rejects the compact output, separate syntax from application rules. Check the delivered contents and unit or type expectations, preserve the error, and avoid repeatedly modifying the source at random. Use the existing JSON Validator to check the same strict parsing contract or the formatter for readability. A clear handoff records the operation, source assumptions, reviewed result and the checks that remain with the receiving system.

Format reference (local parser policies are described separately): RFC 8259 JSON format reference.

Worked examples

Input and settings

{
  "label": "keep this space",
  "items": [1, 2]
}

Expected output

{"label":"keep this space","items":[1,2]}

Whitespace between tokens is omitted. The spaces inside “keep this space” are part of the data and remain.

Related tools

JSON Formatter & Beautifier · JSON validator · JSON document to JSON string

Find a tool

Type a tool name, such as JSON or percentage.

Quick links

Browse by category

All tools