UtilityToolsLab

© 2026 UtilityToolsLab. Built and maintained by the UtilityToolsLab Team.

Free eBooks·About·Changelog·Privacy Policy·Terms of Service·Report a bug
HomeCode & DevJSON Minifier

Related Tools

JSON FormatterBase64UUID GeneratorJWT DecoderTimestampRegex TesterRandom JSON GeneratorAPI Load TesterJSON Diff CheckerJSON Path FinderSchema ValidatorXML FormatterHTML FormatterCSS FormatterCSS MinifierJS MinifierHTTP Status CodesASCII Table

JSON Minifier & Compressor

Squeeze any JSON to one line. Strips whitespace, removes comments, sorts keys and escapes non-ASCII. Stats bar shows bytes saved. Copy or download as .min.json.

You Might Also Like

All Code & Dev

JSON Formatter

Paste raw JSON to instantly format, beautify, validate and minify it. Syntax errors are pinpointed by line and column. Free and fully private.

Base64

Encode text or data to Base64 and decode Base64 strings back to readable text. A fast developer utility for API payloads, tokens and data URIs.

UUID Generator

Generate RFC 4122 compliant UUID v4 strings with one click, or batch-generate up to 100 unique IDs at once. Cryptographically random and free.

JWT Decoder

Decode and inspect JSON Web Tokens. View header, payload, and signature. Detects expiry and maps all registered JWT claims.

Paste a JSON document and the minifier strips every byte of whitespace the spec does not require: indentation, blank lines, the space after each colon. The result is a single dense line ready for a network payload, a config embed, or a cache key. The lead sample, a service descriptor with nested objects and an array, compresses from 260 bytes to 204 bytes (21.5% reduction) without touching a single value.

Three toggles let you go further or stay safer. Strip comments (on by default) removes // line and /* block */ comments before parsing, which is the one thing standard JSON.parse refuses to do. Turn it off when your document has no comments and you want to be certain nothing is consumed. Sort keys A to Z walks the entire object tree and emits every key in lexicographic order, making two logically identical documents byte-equal so a diff tool or a hash comparison treats them as the same file. Escape non-ASCII replaces every character above U+007F with its \uXXXX sequence, useful when the output will travel through a system that is not encoding-aware.

The stats bar shows original bytes, minified bytes, bytes saved and reduction percentage. Everything runs in the browser tab with no upload, no server, and no account.

Worked Example: a Service Config Compressed

The lead sample is a checkout-api service descriptor with four top-level keys, a nested env object and a two-item features array. Click Load Sample and the input fills with 260 bytes of pretty-printed JSON. The output panel immediately shows the single-line result at 204 bytes: 56 bytes saved, 21.5% reduction. Turn on Sort keys A to Z and the output re-orders to env, features, owner, replicas, service, version. That is useful when you need two versions of the same config to compare cleanly by hash rather than by eye. Click Load Sample a second time to advance to the shipment document, which minifies its nested legs array of objects in the same pass.

Edge Cases That Catch People Out

  • Trailing commas in objects or arrays are invalid JSON even though many editors write them. The parser will report Invalid JSON — Unexpected token on the first trailing comma it finds. Strip the comma and re-paste.
  • Comments with Strip comments off will fail with Invalid JSON — Unexpected token / because JSON.parse treats // as a syntax error. The toggle is on by default precisely to prevent this, but if you turn it off for a comment-free document and see that message, a comment crept in.
  • Numbers larger than 253 − 1 (i.e. Number.MAX_SAFE_INTEGER) parse correctly but are serialised back to the nearest float, which may not be the value you started with. BigInt JSON is not part of the spec, so this is a limitation of the format rather than the tool.
  • Sort keys is applied after parsing, so it only reorders keys the parser already accepted. A document with a duplicate key (e.g. two "id" fields) will have the first value silently overwritten by the second, as per the ECMA-262 spec for JSON.parse. The output will be valid but may be smaller than expected.
  • Empty input is reported as Input is empty — paste or load some JSON to minify. rather than a parse error.

Options

260 bytes → 204 bytesSaved 56 bytes21.5% reduction
{"service":"checkout-api","version":"2.4.0","replicas":3,"env":{"LOG_LEVEL":"info","TIMEOUT_MS":3000},"features":["apple-pay","gift-cards"],"owner":{"team":"payments","oncall":"ana.ruiz@harbourline.dev"}}