Press Format or Minify, or turn on Auto update.How to use
Add your JSON
Paste JSON into the Input box, drop a .json file on it, press Upload .json, or press Load URL and fetch a public JSON address. Try sample loads a small product record.
Choose options and format
Pick an Indent from 1 to 4 spaces or Tab, and a Sort keys order if you want one. Press Format, or Minify for one compact line. Tick Auto update to reformat as you type.
Read, copy or explore
Copy or download the result from the Formatted tab. Switch to Tree to fold, search and copy paths, or to JSONPath to run a query such as $..price.
Why JSON Formatter
- Keeps numbers and key order exactly as written, so 1.0 and long IDs are not rewritten.
- A collapsible tree view with search and copy path, plus a JSONPath query tab, in the same page.
- Errors are highlighted on the exact line with a reason, and common mistakes are fixed in one click.
- Indent with 1 to 4 spaces or tabs, sort keys A to Z or Z to A, then copy or download.
Format, minify or validate: which JSON tool to use
The JSON tools on this site overlap, but each one is built around a different question. Use the table to pick the right page for the job.
A common flow for broken JSON is to find the error in the validator, fix it, then come back here to format or minify the clean result. When the JSON needs to become another format, the converters take the same pasted input.
| Task | Tool | What it does |
|---|---|---|
| Make JSON readable | JSON Formatter | Indents with 1 to 4 spaces or tabs, keeps numbers exact, can sort keys |
| Browse a large payload | JSON Viewer | Collapsible tree, table view, JSONPath and stats |
| Squeeze JSON onto one line | JSON Formatter or JSON Minifier | Minifier adds byte counts, escaped string output and a clean-first option |
| Find why JSON is invalid | JSON Validator | Line highlight, plain-English reason, auto-fix and optional JSON Schema check |
| Open JSON in a spreadsheet | JSON to CSV or JSON to Excel | Flattens nested objects into columns |
| Type JSON for a TypeScript project | JSON to TypeScript | Interfaces, type aliases or a Zod schema from a sample |
Before and after: one line in, a readable tree out
The sample is a product record squeezed onto a single 224-character line: an id, a name, a price, a stock flag, a tags array, a dimensions object and two variants. Format with 2 spaces turns it into 26 indented lines, where each key sits on its own line and each nesting level steps in by two spaces.
The data does not change. Keys stay in the same order, and 34.5 stays 34.5. Minify reverses the process and gives back the original line. If you sort keys A to Z, dimensions, id, inStock, name, price, tags and variants move into alphabetical order at every level, while the two variants keep their places in the array.
For a payload that is too long to read even when indented, switch to Tree. Top-level keys start open two levels deep, arrays show their length in brackets, and the search box opens every branch that contains your word.