inyourbrowser.com

JSON Minifier

Strip all whitespace from JSON to make it as compact as possible. Runs in your browser.

Input JSON
Output

FORMAT

INDENT

Tips

Paste JSON in the left pane. Output updates instantly.

Runs entirely in your browser

How it works

Minifying calls JSON.parse on your input to confirm it is valid, then JSON.stringify(value) (with no indent argument) re-emits the same data with all incidental whitespace removed. The result is the smallest possible representation of your JSON, ideal for API payloads, localStorage entries, and embedded config strings inside source code.

Example

Whitespace between tokens is removed, and text inside strings is left alone:

{
  "id": 7,
  "name": "Ada Lovelace",
  "tags": ["a", "b"]
}
{"id":7,"name":"Ada Lovelace","tags":["a","b"]}

Processing runs in your browser

All processing happens inside your browser tab. Our servers are not involved at any point.

Technical specification

JSON syntax is defined in RFC 8259 (IETF, 2017) and ECMA-404. The tool parses with the browser's strict JSON.parse, so comments and trailing commas are errors, and writes the result with JSON.stringify.

Standard
ECMA-404 / RFC 8259
Browser API
Native JSON.parse and JSON.stringify
Indent
2 or 4 spaces (none when minifying)
Size limit
Browser memory

Related operations

For converting between data formats, try CSV to JSON or the YAML formatter. To decode tokens, use the JWT decoder. For escaping URL data, try URL encode.

Frequently asked questions

Why minify JSON?
Minified JSON is smaller, which reduces payload size in APIs, config files, and localStorage.
Does minifying change the data?
Whitespace is removed and, in current browsers, numbers keep the exact text you typed, including large integers and values such as 1.0. Two things follow standard JSON parsing: if a key appears more than once in the same object, only the last value is kept, and keys that are whole numbers (such as "2" or "10") are listed first, in numeric order. Older browsers may round integers longer than 15 digits, and the tool shows a note when that can happen.
Is the result valid JSON?
Yes. Minified JSON is valid and parseable by any JSON parser.
How much smaller does minified JSON get?
Minifying removes the spaces, tabs, and line breaks between tokens, so most of the saving comes from the indentation and line breaks in your input. The bar under the output shows the size of the minified result.

Last reviewed September 30, 2026

Other pages for this tool

Related tools

CSV ↔ JSON
Convert CSV to JSON and JSON back to CSV. Handles quoted fields and downloads.
YAML formatter
Format, validate, and convert YAML. Compatible with Kubernetes, CI configs, and OpenAPI files.
XML formatter
Pretty-print, minify, and validate XML. Uses the browser's native DOMParser.
JWT decoder
Decode JWT header and payload instantly. All inspection runs in your browser.
SQL formatter
Beautify and format SQL queries. Supports MySQL, PostgreSQL, T-SQL and standard SQL.