How to format JSON online
Learn how to pretty-print messy JSON in your browser with Toolora’s free JSON Formatter.
Why format JSON?
Minified or one-line JSON is hard to read. Formatting adds indentation and line breaks so objects, arrays, and nested fields are easier to inspect while debugging APIs or config files.
Steps
1) Open the JSON Formatter tool. 2) Paste JSON into Raw JSON Input — the prettified result updates as you type. 3) Choose 2 Spaces, 4 Spaces, or Tabs, and turn on Sort Keys Alphabetically if you want keys in order. 4) Use Copy Code on the output pane. If the JSON is invalid, a syntax-error banner appears over the last good output; fix the reported line and column and keep typing.
Tips
Use Minify JSON on the same page when you need a compact payload. JSON Minifier is still available as a dedicated tool. Use JSON Validator if you only want to check validity without rewriting the text. JSON Compare is for two documents. JSON → TypeScript shares the same persist key via Convert to. Trailing commas, unquoted keys, and single quotes are not JSON — the error banner with line and column is the point. Formatting never leaves this tab; keep production secrets off shared machines.
Worked example
Paste {"b":2,"a":1} with 2-space indent and sort keys. The output becomes a readable object with a before b, which makes git diffs of API dumps less noisy when key order was the only difference. Invalid input such as { a: 1 } (unquoted key) shows a parser error instead of a guessed fix. Indent, sort, and minify all sit on this public URL; bookmark it if you pretty-print JSON often.