Format, prettify, minify, and validate JSON data instantly with customizable indentation and key sorting
Instantly convert single-line or cluttered JSON into clean, readable code with 2-space, 4-space, or Tab indentation.
Remove whitespace and newlines to compress payload sizes for API calls, configuration files, or database storage.
Sort JSON object keys alphabetically for easy diffing, and fix common errors like single quotes or trailing commas.
Hop to nearby dev utilities without losing context.
Quick steps so you can get results fast.
Paste or type JSON into the input panel. A sample is loaded so you can see the result straight away.
Choose 2 spaces, 4 spaces or tabs, and turn on key sorting if you want stable, diff-friendly output.
Format adds line breaks and indentation; Minify removes all unnecessary whitespace.
Copy the output or download it. Errors are shown instead of output when the input is not valid JSON.
Everything you need to know about JSON Formatter.
Answers to the most common devtool questions.
The formatter accepts strict JSON only. Comments, trailing commas, single-quoted strings and unquoted keys are valid in JavaScript but not in JSON, so remove them first.
No values change. Only the order of keys inside each object changes; array order is kept.
No. This tool runs in your browser with JavaScript, and what you type or paste is not sent to ToolzStack servers. Page visits are measured with Google Analytics, as described in the Cookie Policy.
Your input stays in the page while it is open. A few tools keep a short history or favourites in the local storage of this browser; you can clear it in the tool or in your browser settings.
Use Report a Bug on the page or the contact form, and include a sample input that shows the problem (remove anything sensitive first).