Minify JSON without changing numbers or strings, strip comments and trailing commas, and see the bytes saved.
JSON Formatter
Pretty-print or minify JSON with your choice of indentation and optional key sorting.
Runs in your browser — nothing you enter is sent to our servers
How it works
Your input is parsed with the browser’s standard JSON.parse, optionally re-ordered (sort keys), then written back with JSON.stringify using your chosen indentation — or with no whitespace at all for Minify. If parsing fails, you get the error and a link to the validator for a precise diagnosis. Press Ctrl/⌘ + Enter to re-run.
Minify here re-serialises the data, which tidies numbers (1.50 becomes 1.5). To keep every value exactly as written, or to strip comments from JSONC, use the JSON minifier.
Example
The minified input {"name":"ToolTarvern","free":true} formatted with 2 spaces becomes:
{
"name": "ToolTarvern",
"free": true
} Frequently asked questions
Is my JSON sent to a server?
No. Formatting uses your browser’s built-in JSON engine. Your data stays on your device — important if it contains API keys or personal information.
What does “sort keys” do?
It orders object properties alphabetically at every level, which makes two JSON documents easier to compare.
My JSON won’t format. Why?
It is probably invalid — common causes are trailing commas, single quotes and comments. The JSON Validator shows exactly where the problem is and why.
Will large numbers keep their precision?
JavaScript stores numbers as 64-bit floats, so integers larger than 9,007,199,254,740,991 can lose precision when reformatted. If you work with very large IDs, keep them as strings.
Related tools
Validate JSON and pinpoint errors by line and column — including duplicate keys that most parsers ignore.
Decode a JSON Web Token, check its claims and expiry, flag risks, and verify HS, RS, PS, ES or EdDSA signatures.
Generate random v4 or time-ordered v7 UUIDs in bulk, in the format you need.
Related guides
JWTs explained: structure, claims, decoding vs verifying, and common mistakes
How JSON Web Tokens work, what each part and claim means, why decoding isn't verifying, and the mistakes that cause real security bugs.
JSON, Base64, URL encoding and HTML entities explained
What JSON, Base64, percent-encoding, HTML entities, UUIDs and Unix timestamps are for — and the common mistakes developers make with each.
Zapier vs Make: which automation platform fits your team?
Zapier and Make both connect your apps without code, but they think about automation differently. Here's how to choose based on how your team works.