JSON Minifier & Formatter

Format for humans. Minify for machines. Sort keys for sanity.

ORIGINAL243 BMINIFIED202 Bβˆ’16.9% whitespaceSTRUCTUREDepth2Keys8Arrays1Nulls0Strings5
Mode

βœ“ Valid JSON

Input Stats

Size: 243 B
Whitespace: 41 B
Depth: 2 levels
Keys: 8

Output Stats

Size: 255 B
Saved: βˆ’41 B
Ratio: βˆ’16.9%
Type: 2 obj Β· 1 arr

🎯 A Simple Example: Cleaning Up an API Response

You've just fetched a user record from a third-party API. It came back as one long line of minified JSON and you need to read it. Or the reverse: your config file looks beautiful locally but you want the smallest possible version for production.

Steps:

1️⃣ Paste your JSON into the left panel β€” the default Marie Curie sample shows a well-structured nested object with strings, numbers, an array, and a nested object.

2️⃣ Click Minify β€” the 246-byte formatted version becomes 187 bytes, a 24% reduction. The right panel shows the single-line output ready to copy.

3️⃣ Switch to Format β€” instantly readable again, with 2-space indentation. Use this when an API hands you a compact blob you need to read or debug.

4️⃣ Toggle Sort Keys β€” keys alphabetize recursively. "born" moves before "country", "chemistry" before "physics". Now two versions of the same JSON object will produce identical output β€” making diffs reliable.

5️⃣ Watch the SVG compression meter and the structure panel β€” depth, key count, null count, and type breakdown update live. Lots of nulls? Your API may be over-delivering optional fields you don't need.

Pro tip: Sort Keys + Minify + copy is the fastest way to generate a canonical JSON fingerprint β€” two objects with the same data will always produce identical strings, making equality checks or hash comparisons trivial.

Data Source: Ecma International β€” ECMA-404: The JSON Data Interchange Standard (Open Standard) β€’ Public domain β€’ Solo-developed with AI

Browse JSON & API Programming Books on Amazon

As an Amazon Associate, I earn from qualifying purchases.

Lab Notes

Why the Humble Comma Matters: The History of Data on the Wire

Telegrams Charged by the Character: In the 1850s, sending a telegram meant paying by the word β€” sometimes by the letter. Skilled telegraph operators developed a professional art form: compress the message to its essential meaning without losing a single fact. "Am arriving Tuesday evening stop please arrange accommodation stop" became "TUE EVE NEED ROOM." The compression ratio: about 50%. Sound familiar? JSON minification is exactly this logic, applied to computer data instead of Victorian correspondence. Every space, newline, and indent in a formatted JSON file is there for you β€” the human reader. Machines don't need them. Strip them out, and you have a telegram.

How JSON Works β€” and Why Formatting Exists at All: JSON (JavaScript Object Notation) was formalized by Douglas Crockford in the early 2000s as a lightweight alternative to XML. The specification itself takes just a few pages β€” it's beautifully simple. A JSON file contains exactly the same data whether it has pretty indentation or no whitespace at all. The format is defined by braces, brackets, colons, commas, strings in double quotes, and primitive values. Whitespace between those tokens is completely ignored by every JSON parser ever written. So "format" and "minify" produce semantically identical documents. One is for humans; one is for machines. This tool gives you both, plus a third trick: Sort Keys, which alphabetizes every object's keys recursively β€” invaluable when diffing two JSON files or comparing API responses.

Why This Matters Today β€” APIs, Configs, and the 40% You Didn't Know You Were Sending: The average well-formatted API response is 30–60% whitespace by byte count. On a high-traffic API serving a million requests per day, that whitespace adds up to real bandwidth costs. More importantly, formatted JSON in configuration files (package.json, tsconfig.json, .eslintrc) is the friendly face developers see every day β€” while production services quietly minify those same files before serving them. This tool bridges the gap: paste minified API output to make it readable, or paste your beautiful hand-formatted JSON to compact it for production. The Sort Keys feature is a hidden gem β€” two JSON objects with identical content but different key order look different in a plain text diff. Alphabetized keys make equality checks instant.

Reading the Structure Report: The stats panel shows you more than just byte counts. It reports nesting depth (how many levels your JSON goes β€” deeply nested JSON often signals over-engineering), total keys (useful for spotting bloated response payloads), and a type breakdown: strings, numbers, booleans, nulls, arrays, and objects. A JSON response with dozens of null values often indicates optional fields being transmitted unnecessarily. Knowing your data's shape is the first step to designing leaner APIs β€” and the lab cat discovered this the hard way, finding 47 null fields in one response and suspecting someone was being paid by the field.

🐱 From the Lab Cat's Data Compression Division: I intercepted a JSON payload from the treat-ordering API. It was 1,247 bytes. After minification: 891 bytes. After removing the 23 null fields and the redundant "treatStatus": "pending" that updates every second: 204 bytes. I have achieved a 83.7% compression ratio and also ordered extra treats in the space I saved. Efficiency is its own reward. πŸ“¦πŸΎ

In short: These tools are for education and curiosity only. Always verify information independently and consult professionals before making important decisions.

Riatto.ovh Β© 2025 – 2026. Designed and maintained by a solo developer with AI.

Privacy Policy

Also by us: Purr.ovh Β· Snackword.ovh Β· Substack