OneFreePlaceFree tools. No account.
Tool #331 · Developer Tools

JSON Minifier

Ship smaller JSON without losing control. Use token-preserving minification, exact validation, duplicate-key auditing, real gzip measurements, JSON Lines support, and private batch processing — all on this device.

Lossless token-preserving removes only JSON whitespace outside strings. It preserves number spellings, key order, duplicate keys, and escape spellings exactly.

Input

Drop .json, .jsonl, .ndjson or text here · UTF-8 / UTF-16 BOM aware
0 B · 0 lines

Minified output

Shortcut Ctrl/⌘ + Enter
Waiting for inputReady
Input—
Minified—
Saved—
Gzip after—
Max depth—
SHA-256—

Integrity & safety audit

Built for deployment decisions
•
Minify a document to run the audit.

Structure

No content is stored
•
Objects, arrays, values, keys and duplicate keys will appear here.

Batch queue

No files queued.

Batch report

JSON uses strict mode; .jsonl/.ndjson use record mode.
FileStatusBeforeAfterSaved
Queue files to begin.

How to use it

Paste JSON or load a local file, choose Strict JSON or JSON Lines / NDJSON, keep Lossless for safest whitespace-only minification, then press Ctrl/⌘ + Enter. Review validation, duplicate-key audit, raw/gzip savings and the SHA-256 fingerprint before copying or downloading.

Why lossless mode matters

Many minifiers parse and reserialize JSON. That can rewrite a number such as 1e2 to 100, normalize negative zero, change escape spelling and collapse duplicate object keys. OneFreePlace validates first, then removes only insignificant JSON whitespace, so token spelling is retained.

Minification vs gzip

Whitespace removal reduces the raw payload. HTTP compression can reduce it much further. This tool measures actual gzip output in browsers that support CompressionStream, so you can compare raw and transfer-size savings instead of relying on a character estimate.

Duplicate-key audit

Duplicate object keys are accepted by many parsers but are risky because consumers can disagree about which value wins. Lossless mode preserves every occurrence and flags duplicates, including escaped-equivalent keys such as "a" and "\u0061".

JSON Lines / NDJSON

Each non-empty line is validated and minified independently, and record boundaries remain line-based. Blank lines are ignored. This is useful for logs, event streams, bulk exports and datasets where one JSON value per line is intentional.

Privacy model

There is no server-side processing path. File reading, validation, minification, hashing, compression measurement and ZIP creation happen locally in your browser. The tool does not persist your document in local storage.

Practical use cases

  • Shrink API fixtures, static JSON assets and configuration files before deployment.
  • Clean NDJSON logs while keeping one-record-per-line boundaries.
  • Audit duplicate keys before a payload reaches a parser that silently keeps only one value.
  • Batch-minify local exports and package successful files with a CSV report.
  • Compare raw size with actual gzip size for delivery planning.

Worked example

Input: { "rate": 1e2, "message": "a b" }

Lossless: {"rate":1e2,"message":"a b"}

Normalized: {"rate":100,"message":"a b"}

Whitespace inside strings is data and is never removed.

Compatibility & limits

This tool intentionally validates strict JSON. JSON5, comments, trailing commas, single-quoted strings and unquoted keys are rejected rather than silently rewritten. Gzip measurement requires browser support for CompressionStream; minification still works when that metric is unavailable.

FAQ — Is lossless mode safer?

For production minification, usually yes. It removes only insignificant whitespace while preserving number notation, escape spelling, key order and duplicate-key occurrences. Normalized mode is useful when you explicitly want parse-and-reserialize behavior.

FAQ — Does it upload my JSON?

No. Processing is local to the page. You can use file input, batch processing, hashing and ZIP export without sending document contents to a OneFreePlace server.

FAQ — How are large files handled?

Large inputs use a background worker path so parsing and minification do not unnecessarily block the interface. Exact practical limits still depend on the device, browser memory and file complexity.

FAQ — What file encodings work?

File loading supports UTF-8, UTF-8 with BOM, UTF-16LE with BOM and UTF-16BE with BOM. Text pasted into the editor is handled as normal browser Unicode text.

FAQ — What does the hash prove?

The SHA-256 fingerprint lets you compare the exact minified output with another copy or pipeline artifact. A matching digest is strong evidence that the byte content is identical.

Keyboard & accessibility

Ctrl/⌘ + Enter minifies and Ctrl/⌘ + Shift + C copies a completed result. Editors, tabs and actions are keyboard reachable, focus states are visible, and syntax errors include a line, column and code frame.

Related OneFreePlace tools

#321 JSON Formatter & Validator for readable formatting and validation, #324 Base64 Encode / Decode for encoded payload work, and #327 Hash Generator & Verifier for broader integrity checks. Tool #331 stays focused on safe, measurable JSON minification instead of duplicating those tools.

Batch workflow

Queue up to 100 .json, .jsonl or .ndjson files, run validation/minification, then export a ZIP containing only successful outputs plus a CSV report. Invalid files are listed but excluded from the output bundle.

When not to use it

Do not use normalized mode when preserving duplicate keys, numeric token spelling or exact escape spelling matters. Do not treat gzip estimates as a replacement for measuring your real production CDN/server configuration, which may use different compression levels or Brotli.