Strip every whitespace · RFC 8259

Minify any JSON to the smallest possible payload

Paste pretty JSON, get a wire-ready compact version. Live byte savings, copy or download, 100% in your browser.

JSON Minifier Workspace
Input size
321 B
10 lines
Output size
250 B
1 line
Bytes saved
71 B
22% smaller
Status
Valid
16 keys
input · pretty json
output · minified
{"company":"TryDevTools","founded":2024,"employees":[{"id":1,"name":"Ada Lovelace","role":"admin","active":true},{"id":2,"name":"Linus Torvalds","role":"engineer","active":true},{"id":3,"name":"Grace Hopper","role":"admin","active":false}],"count":3}
Step-by-step Tutorial

How to minify JSON: a complete step-by-step guide

JSON minification removes every non-essential whitespace character — spaces, tabs, newlines, and indentation — from a JSON document to produce the smallest possible representation. This guide walks through using a free online JSON minifier to compress API payloads, configuration files, NoSQL records, and any other JSON data, with full RFC 8259 validation and live byte-savings metrics. Everything runs locally in your browser, so your data never leaves your machine.

  1. 01

    Paste, drop, or type your JSON document

    Drop any valid JSON document into the input editor on the left of the workspace. The minifier accepts REST API responses, GraphQL payloads, configuration files such as package.json or tsconfig.json, exported analytics, log entries, NoSQL records, and any other valid JSON input from a few bytes up to several megabytes.

    You can paste from the clipboard with ⌘V / Ctrl+V, drag a .json file directly onto the panel, or edit JSON inline with syntax-aware behaviour. Parsing happens client-side as you type — no upload to any server, no signup, no rate limits.

    API responseconfig fileGraphQLlog payload
    input · pretty json.json
    {
      "user": "ada",
      "active": true,
      "roles": [
        "admin",
        "founder"
      ]
    }
    87 B · 7 linespretty-printed
  2. 02

    Validate against the RFC 8259 specification

    Every document is parsed using the browser's native JSON.parse engine, which strictly enforces the RFC 8259 standard. Invalid trailing commas, unquoted keys, unterminated strings, duplicate identifiers, control characters, and other syntax errors surface instantly with the exact error message and character position.

    Strict JSON does not allow comments or single-quoted strings by design — if you need those, use a JSON5 validator instead. Otherwise, fix the highlighted issue inline and minification resumes automatically.

    RFC 8259strict parseerror position
    validation errorline 3 · col 18
    SyntaxError:
      Unexpected token ',' at
      position 42 in JSON.
    
      → trailing comma after
        "roles" array
    fix → retryRFC 8259 § 4
  3. 03

    Review live byte savings and compression metrics

    The stats bar above the editor updates in real time as you type, showing input size, minified output size, total bytes saved, and percentage reduction. Typical pretty-printed JSON shrinks 20–40% after whitespace removal; deeply nested or heavily indented documents often save 50% or more.

    Stack JSON minification on top of gzip or brotli compression for the best total payload reduction — minify first to strip redundant whitespace, then let your CDN or web server compress the remaining tokens.

    bytes savedgzip compatiblebrotli compatible
    output · minified1 line
    {"user":"ada","active":true,"roles":["admin","founder"]}
    56 B− 31 B · 36% smaller
  4. 04

    Copy to clipboard or download as a .min.json file

    One click sends the minified JSON to your clipboard, ready to paste into a request body, environment variable, GitHub commit, Postman collection, or test fixture. Alternatively, download the result as a .min.json file ready to ship inside CDN bundles, iOS asset catalogs, Android res/raw directories, Docker images, or document-database imports.

    Because the entire tool runs in the browser, your data stays on your device — perfect for sensitive payloads, internal API responses, or pre-production fixtures. Open DevTools → Network to verify zero outbound requests after the page loads.

    clipboard.min.jsonoffline-capableprivacy-first
    export2 outputs
    ✓ Copied to clipboard
    ✓ Saved: output.min.json
    ✓ 0 outbound requests
    ✓ 100% client-side
    ready to shipsuccess
Pro tips

Production-grade JSON minification, the right way

Stack minify + gzip

Minify removes whitespace; gzip and brotli compress repeated tokens. Together, they typically cut JSON payloads by 70–85% over the wire.

Keep the pretty source

Source-control the pretty-printed version for diffs and code review; minify on build. Use the Re-format input button to round-trip safely.

Beware NaN and Infinity

Strict JSON has no representation for NaN, Infinity, or undefined. Replace them with null or stringified sentinels before minifying.

Preserve key order

This minifier preserves the original key order. If you need canonical, sortable output for signing or hashing, run keys through Sort JSON Keys first.

Watch big-integer precision

JavaScript loses precision past 2^53−1. For ledger or blockchain payloads, transport large integers as strings to survive round-trips.

Embed in HTML safely

When inlining minified JSON inside a <script> tag, escape </ sequences to <\/ to prevent premature tag closure.

Use Cases

When to minify JSON

Every kilobyte compounds across millions of requests. Here are the scenarios where engineering teams reach for JSON minification before shipping.

REST & GraphQL APIs

Strip formatting whitespace before responding to clients. Even with gzip enabled, minified JSON parses faster on the receiving end and reduces TLS frame counts on mobile networks — the highest-impact win for any public API.

avg. 30% smaller payload

Build artifacts & bundles

Embed configuration, translation files, or feature flag manifests in shipped JavaScript bundles, iOS asset catalogs, and Android res/raw directories without the dead weight of formatting whitespace inflating your app binary.

smaller install size

Storage & document DBs

Compact JSON in DynamoDB items, Redis values, MongoDB documents, and Postgres jsonb columns where every byte affects throughput limits, RU consumption, and per-record storage cost.

lower cloud bills

CDN & edge caching

Smaller files mean faster cache fills, lower egress costs on Cloudflare, Fastly, or CloudFront, and quicker time-to-first-byte for users on the far side of the world from your origin.

faster TTFB

Mobile & low-bandwidth clients

Cellular users on 3G networks, IoT devices on metered SIMs, and embedded browsers all benefit disproportionately from minified payloads. Less data over the air also means measurably lower battery drain on long-polling clients.

friendlier on metered data

Embedding JSON in source

Inline JSON inside HTML <script> tags, JavaScript string literals, or environment variables. Single-line minified JSON sidesteps quoting headaches, multi-line escape sequences, and accidental syntax errors during code review.

copy-paste safe
FAQ

Frequently asked questions

Common questions about JSON minification.

Removes every space, tab, and newline that doesn't appear inside a string value. The result parses identically — it's just much smaller, ideal for HTTP transfer.
Typical pretty-printed JSON shrinks 20–40% when minified. Deeply nested documents save even more — sometimes 50%+.
Gzip + minify gives the best total compression. Minify first to remove redundant whitespace, then gzip handles the repeated patterns in the remaining content.
No. Keys, values, types, and ordering are preserved exactly. Only the formatting whitespace is removed.
Never. All minification happens locally via JSON.parse + JSON.stringify. Open your network tab — zero requests.
Suggest a tool

Something missing?

Tell us what you need. We ship the top requests every two weeks.

Sent straight to the maintainers · no account needed
47 in queue·8 shipped this month
Request queued. Thanks!