How to format JSON
Pretty-print messy or minified JSON in your browser with JSON Quiet.
Formatting JSON (also called pretty-printing or beautifying) turns a dense one-line payload into a readable tree of objects and arrays. That makes it easier to spot missing fields, compare API responses, and paste structure into documentation or tickets. This guide walks through the workflow on JSON Quiet — a free, client-side formatter that does not upload your text to our servers for processing.
Before you start
You only need a modern browser and some JSON text. That text might come from a REST response, a log line, a config file, or a teammate’s paste. If the content includes secrets (tokens, passwords, personal data), redact them first — privacy is about judgment as much as architecture. JSON Quiet processes formatting locally, but anything on your screen can still be copied elsewhere.
Step 1 — Open the formatter
Go to the JSON Quiet homepage. You will see a large editor, Format / Validate / Copy actions, and an Options control for indentation and validation mode. No account is required.
Step 2 — Get JSON into the editor
Use whichever path matches your source:
- Paste raw JSON into the box.
- Open a local
.jsonor text file, or drag and drop a file onto the editor. - URL — paste a public
.jsonURL when the resource is meant to be fetched by the browser.
If the input is not valid JSON yet, Format may fail until you fix syntax. That is expected; see the common errors guide when parsers complain about commas, quotes, or comments.
Step 3 — Choose indentation
Open Options and pick an indentation style before formatting:
- 2 spaces — common in JavaScript and many front-end codebases; keeps nested objects readable without huge horizontal width.
- 3 spaces — a compact middle ground used as a default on this site; fine for reading API bodies.
- 4 spaces — familiar in Python-adjacent and some enterprise style guides; good for deep nesting when you prefer more visual separation.
- Tab — useful if your editor or team standardizes on tabs.
- Compact — removes unnecessary whitespace for a single-line (or minimal) payload when size or “paste into a form field” matters more than readability.
Indentation does not change the data — only how it is printed. After you format, you can switch Options and format again to restyle the same document.
Step 4 — Click Format
Press Format. If the JSON is valid (under your current validation setting), the editor updates with pretty-printed output and a status confirming success. If formatting fails, read the status message carefully: line and column clues usually point to the first syntax problem.
For large documents, use the expand control to open a wider editor. Edits there stay in sync with the main box so you can fix issues without losing context.
Step 5 — Validate (recommended)
Formatting assumes the text can be parsed. Click Validate to confirm the result (or the original input) against RFC 8259 in strict mode, or use relaxed mode while you clean up known non-standard quirks. Validation is covered in detail in the validate JSON guide.
Step 6 — Copy or save the result
Click Copy to place the formatted text on the clipboard. Paste it into your IDE, ticket, or commit. If you need a file again, paste into a local editor and save — JSON Quiet does not keep a cloud history of your documents.
Practical tips
- Format first when you only need to read a minified response; validate when you are about to ship or store the document.
- Prefer consistent indentation across a project so diffs stay small.
- Use compact mode for embedding JSON in query strings or tightly constrained fields — then pretty-print again when debugging.
- If Format fails after a “small” edit, check for trailing commas and single-quoted strings; those are the most common human mistakes.