Upload or paste JSON to format it into clean, readable JSON and download the formatted result in seconds.
.json file onto the editor. The tool accepts any RFC 8259 valid JSON value — object, array, string, number, boolean, or null. Single-line API responses, escaped log entries, and multi-megabyte config files all work.json.dumps(..., indent=4), Java Jackson default, most government data feeds), or Tab (one tab per level — smaller bytes, configurable display width). Set Sort Keys if you want deterministic, diff-friendly output; leave it off to preserve insertion order..json file. Everything runs in your browser via JSON.parse / JSON.stringify — no upload, no sign-up, no server log of your payload.JSON is wire-format by design: APIs, log pipelines, and config systems strip whitespace to save bytes, leaving you with a dense single-line string that is unreadable to humans. Pretty-printing adds line breaks after every key-value pair and array element, indents nested levels consistently, and aligns closing delimiters with their openers. The data is byte-for-byte equivalent — only the presentation changes — but the hierarchy becomes scannable. Common scenarios where this matters:
curl body into the formatter exposes the nested structure of GraphQL or REST responses in seconds; missing fields, unexpected nulls, and wrong data types jump out instead of hiding inside a 4 KB single line.package.json, tsconfig.json, .eslintrc.json, app.json, and Terraform variable files all diff cleanly only when each property sits on its own line. Auto-formatting before commit is why Prettier ships JSON support out of the box.structlog, AWS CloudWatch) collapse events to single lines. Formatting one entry recovers the full event tree, including stack traces and request metadata.| Operation | What it does | Use when | xconvert tool |
|---|---|---|---|
| Format | Adds whitespace; preserves all data | Reading, diffing, debugging, documentation | This page |
| Minify | Strips every optional space, tab, newline | Embedding in URLs, API bodies, environment variables | JSON Minifier |
| Validate | Parses without re-emitting; returns error position | Pre-flight check before sending to a strict consumer | JSON Validator |
Format and minify are reversible — pretty-print then minify and you get the same bytes you started with (assuming key order is preserved). Validate is read-only; it never modifies your input.
| Indent | Bytes per level | Where it's idiomatic | Notes |
|---|---|---|---|
| 2 spaces | 2 | Prettier (default), npm package.json, React, Vue, Angular, Node.js core |
Most common in JavaScript / TypeScript projects; Prettier writes 2-space JSON regardless of tabWidth settings before v3 |
| 4 spaces | 4 | Python json.dump(..., indent=4), Jackson SerializationFeature.INDENT_OUTPUT, .NET JsonSerializerOptions { WriteIndented = true } |
Default in most non-JavaScript stdlibs; preferred for human-readable config and dataset publishing |
| Tab | 1 byte (display width user-controlled) | Some Go projects, older Java codebases, .editorconfig indent_style = tab shops |
Smallest byte cost; renders differently across editors — set explicit tabWidth if you need consistent diffs |
| No indent (minified) | 0 | Network payloads, JWT claims, URL parameters | Use the Minifier; typical 20-40% size drop vs 2-space indent |
Two-space indent is the de-facto JavaScript ecosystem standard — it's what Prettier writes by default, what npm uses for package.json, and what the React / Vue / Angular toolchains expect. Four-space indent is the default for Python's json.dump(..., indent=4), Java's Jackson INDENT_OUTPUT, and most government open-data feeds. Pick what matches your toolchain and stay consistent across the project; mixing the two creates noisy diffs. For shared specs (OpenAPI, JSON Schema), 2 spaces is the more common convention.
No. JSON's whitespace rules in RFC 8259 treat spaces, tabs, line feeds, and carriage returns outside string literals as insignificant. The formatter parses your input with JSON.parse to build an in-memory tree, then re-emits it with JSON.stringify(value, null, indent). The round-trip is byte-equivalent for the data itself — only whitespace changes. Strings, numbers, escape sequences, and Unicode characters inside string values are preserved exactly.
It can if you toggle Sort Keys. With sorting off, output preserves the input's key order. With sorting on, keys at every nesting level are sorted lexicographically by their UTF-16 code units. Sorting is useful for deterministic diffs (so a re-emit of the same logical object always produces identical bytes) and for hash-based caching, but it changes the visible order — be aware if downstream consumers iterate keys (most shouldn't, but some legacy systems do).
The JSON spec (RFC 8259, section 4) says objects are unordered name/value collections — order is technically not significant. In practice, since ES2015 (and ES2019's clarification of OrdinaryOwnPropertyKeys), V8, SpiderMonkey, and JavaScriptCore all preserve insertion order for non-integer string keys in objects, and JSON.stringify walks keys in that same order. Integer-like keys ("1", "2", "42") are sorted numerically first, which is why an object like {"2": "b", "1": "a"} re-emits as {"1": "a", "2": "b"} even without sort-keys enabled.
Minify for the wire, format for the editor. Minified JSON is 20-40% smaller and faster to parse over the network, which is why APIs and JWT claim sets ship without whitespace. But check in formatted JSON to version control — Git diffs are line-oriented, and a one-line minified package.json makes every change show as a full-file rewrite. Most teams use a pre-commit hook (Prettier, lint-staged) to keep checked-in files formatted, then minify at build time or rely on HTTP gzip / brotli to do the size reduction automatically.
Strict JSON does not allow comments — RFC 8259 omits them deliberately. JSON.parse rejects // and /* */. JSONC (VS Code's tsconfig.json dialect) and JSON5 add comments and trailing commas, but they are not valid JSON; this formatter will reject input that contains them. Strip comments first (regex /\/\/.*$|\/\*[\s\S]*?\*\//gm for most cases), or use a JSON5-aware tool. After formatting, you can re-add comments manually if you're targeting JSONC consumers.
VS Code uses the same JSON.parse + JSON.stringify round-trip under the hood (or Prettier if installed). The functional output is identical for valid JSON. The differences: VS Code requires opening the file in the editor and can struggle on documents past ~50 MB; this tool handles paste-and-go for an API response, runs offline after first load, and exposes a sort-keys toggle that VS Code's default JSON formatter does not. For batch processing, jq '.' file.json (pretty-print) or jq -c '.' file.json (minify) is faster.
Prettier is a code formatter — it enforces opinionated style across JSON, JS, TS, CSS, Markdown, YAML, and more, and is best used inside an editor or pre-commit hook on tracked source files. jq is a JSON query and transform language; its . filter pretty-prints, but its real strength is filtering, mapping, and projecting fields (jq '.users[].email'). Use Prettier when you're keeping a file in sync with your project's code style; use jq when you're slicing a payload at the command line or scripting a transform. This web formatter sits between them — paste-and-go without installing anything, useful when you don't want to open an editor or write a jq expression.
NDJSON (also called JSON Lines, .ndjson, or .jsonl) puts one JSON value per line — streaming tools like Elasticsearch's bulk API, BigQuery loads, and jq --slurp use it. This formatter treats the entire input as a single JSON value, so it will fail on NDJSON. Either format each line individually, or convert to a JSON array first (jq -s '.') and then format the resulting array. For comparing two NDJSON files line-by-line, try Text Diff.
There is no hard cap — everything happens in your browser. Performance is best on files under about 10 MB; larger inputs (up to ~100 MB) work but may pause the tab during parse. For very large files (hundreds of MB or more), use jq from the command line, or stream-process with a SAX-style parser like Python's ijson. No data ever leaves your machine, so even multi-megabyte payloads with credentials or PII stay private.