JSON formatter
Format, validate and minify JSON with precise error locations and key sorting.
How to use
Paste or type your JSON into the editor and it is formatted (pretty-printed) instantly, with consistent indentation that makes nested objects and arrays easy to read. If the JSON is invalid, the tool points to the problem so you can fix a stray comma or missing bracket quickly.
Use the minify option to strip all whitespace when you need the smallest possible payload for an API request or a config file, and the copy button to grab the result. You can switch between beautified and minified output as often as you like.
Everything happens in your browser, so even large or sensitive JSON never leaves your device. That makes it safe for API responses, tokens or config that you wouldn't want to paste into a server-side tool, and it keeps working offline.
Examples
Paste a single-line JSON blob and read it as a clean, indented tree.
Catch a trailing comma or unquoted key before it breaks your build or request.
Collapse a formatted config back to one line to shave bytes off the payload.
Frequently asked questions
Does it validate as well as format?
Yes. Invalid JSON won't format — the tool reports the syntax error so you can find and fix it.
Can it handle large JSON files?
Yes, formatting runs locally in your browser, so it comfortably handles large payloads without uploading them anywhere.
Is my data sent to a server?
No. All parsing and formatting happens in your browser, so your JSON stays private and the tool works offline.
What's the difference between beautify and minify?
Beautify adds indentation and line breaks for readability; minify removes all unnecessary whitespace for the smallest size.
Related tools
Convert between JSON and YAML in either direction, instantly.
Generate TypeScript interfaces from a JSON sample, with nested types inferred.
Encode text to Base64 or decode Base64 back to text, with URL-safe support.
Beautify JavaScript, TypeScript, JSON, CSS, HTML, Markdown, YAML and GraphQL with Prettier.
Compare two blocks of text and highlight added and removed lines or words.