JSON Formatter
About JSON Formatter
JSON Formatter is a free, browser-based tool that formats, minifies, validates, and compares JSON, and can generate sample data. Formatting, minifying, escaping, diffing, and data generation run entirely in your browser, so the JSON you paste stays on your device.
It is made for developers and anyone working with API responses, config files, or log data who needs to read, clean up, or check JSON quickly. You can prettify with 2-space, 4-space, or tab indentation, minify to a single line, escape or unescape strings, and switch to a side-by-side Diff view to spot changes between two JSON documents.
Use it when you need to make a raw API response readable, shrink JSON before sending it, or confirm what differs between two outputs. The Generators menu can build random JSON (objects or arrays, with an optional JSON5 mode) and produce sample data from a JSON Schema for testing or mockups.
Validation reports parse errors so you can fix invalid JSON from the message before formatting, and very large documents may slow the browser. One feature does reach the network: fetching a JSON Schema by URL makes your browser request the external address you enter.
Frequently asked questions
- Does my JSON get uploaded to a server?
- No. Formatting, minifying, escaping, diffing, and data generation all run locally in your browser. The only network call is the optional 'Fetch URL' for a JSON Schema, which requests the external URL you type.
- How do I compare two JSON files?
- Switch to the Diff tab and paste your original and modified JSON into the two side-by-side editors to see the differences. You can format both sides first to make the comparison cleaner.
- What is the difference between Format and Minify?
- Format pretty-prints JSON with your chosen indentation (2 spaces, 4 spaces, or a tab) for readability, while Minify removes all whitespace to produce the smallest single-line output.