Online JSON Formatter — Prettify with Custom Indentation
Format minified or messy JSON with readable indentation, using 2 or 4 spaces or tabs. Formatting runs in your browser and nothing is uploaded.
Format, beautify, or pretty-print JSON
A JSON formatter, a beautifier and a pretty-printer do the same job: re-indent minified or single-line JSON so people can read it. Paste a payload, pick two or four spaces or tabs, turn on Sort keys if you need it, then select Format. Pasting also formats right away. Everything runs in your browser and nothing is uploaded to FastMinify. The text is parsed before any output appears. Invalid JSON is not formatted: the results panel shows the error so you can fix it. For line and column hints while you edit, use the JSON validator. The output is rebuilt from the parsed values, so the data stays the same while the whitespace changes. To shrink a payload instead, use the JSON minifier.
Developer notes
The input is parsed first. Fix syntax errors here or in the JSON validator before formatting. Indent size and style apply on every Format run. Changing an option formats the current input again. Values are kept, but the output is written by JSON.stringify: 89.0 becomes 89, 1e3 becomes 1000, \u00e9 becomes é. Integers beyond 2^53 lose precision, and a duplicated key keeps only its last value. Integer-like keys ("2", "10") move to the top of their object, as in every JavaScript engine. To reduce size, use the JSON minifier. This page is about readability.
Formatting options
- Indent size
- Spaces per indentation level: 2 or 4. Ignored when the style is tabs.
- Indent style
- Use spaces or a tab character for each indentation level.
- Sort keys
- Off by default, so keys keep their order. When on, object keys are sorted at every depth for stable diffs, and arrays keep their order. More sorting options are in <a href="/en/json-sort">JSON Sort</a>.
When to use it
Read minified API logs or webhook payloads during an incident. Normalize fixtures before opening a pull request. Prepare readable snippets for documentation or a Slack thread. Check converter output before exporting it to YAML or CSV.
Worked examples
Minified log line
Sample input
Formatted output
Small nested config
Sample input
Formatted output
Related JSON tools
The JSON tools hub lists the whole family. Check syntax with the JSON validator, compare two versions in JSON diff, or browse keys in the JSON tree viewer. Shrink payloads with the JSON minifier or export through JSON → XML.
JSON formatter FAQ
Readable JSON, same data
Does formatting change values?
The parsed values stay the same, but the text is rewritten. Indentation changes, numbers take their shortest form (89.0 becomes 89) and \u escapes become plain characters.
Difference vs JSON minifier?
The minifier removes whitespace to shrink file size. This formatter adds indentation for human review.
Key order?
Keys keep the order in which they appear, except integer-like keys ("2", "10"), which JavaScript always moves to the top of their object. Sort keys orders every object alphabetically.
Server uploads?
No. Formatting runs in your browser and nothing is sent to FastMinify.
Can I sort keys?
Yes. The Sort keys switch sorts the keys of every object, at every depth, and leaves arrays in their order. For natural or numeric order, array sorting or a depth limit, use the JSON Sort tool.
How do I format JSON with 2 or 4 spaces?
In the options, set Indent to 2 spaces or 4 spaces, or set Style to tabs (one tab per level). The current input is formatted again as soon as you change an option.
What is the difference between a JSON formatter and a validator?
A formatter re-indents valid JSON so you can read it. A validator checks whether the text is valid JSON and shows where it breaks. Use the JSON validator to locate an error, then come back here to format.
JSON Tools
Validate, format, repair, compare and explore JSON in your browser, alongside the JSON minifier and converters.
Explore other tool categories
- Minify
Minify JavaScript, CSS, HTML, JSON, XML, SVG and other formats to cut the bytes you ship, before gzip or a CDN.
- Unminify
Make minified code readable again to debug or review it. Unminify JavaScript, CSS, TypeScript, SCSS, LESS, SQL, YAML and other formats.
- Conversion
Convert data between JSON, YAML, XML, CSV, TOML and other formats locally, with no upload to a server.
- Encoding
Encode or decode Base64, URLs, HTML entities and JWTs, and generate hashes and HMACs in your browser.
- Serialization
Serialize and deserialize PHP data structures beside JSON workflows.
- SVG Tools
Preview, optimize with SVGO, export as a data URI, resize, beautify, convert to JSX and validate SVG in your browser.
- Beautify
Make code readable with consistent indentation. Beautify JavaScript, CSS, TypeScript, SCSS, LESS, Markdown, GraphQL, SQL, YAML and more in your browser.
- CSS preprocessors
Compile SCSS or LESS to standard CSS in your browser. Pair it with beautify or minify to handle a whole stylesheet.
- Color & CSS Tools
Check WCAG contrast, convert CSS colors and units, and generate shades, border-radius and box-shadow code in your browser.
- DevOps & Infra
Terraform HCL format/validate/minify, Dockerfile format & lint, Docker Compose and .env validation.
- CI/CD
Format GitHub Actions and GitLab CI YAML and check the structure of workflows and jobs in your browser.
- Logs & observability
Format, filter and validate JSON and NDJSON logs, and turn Nginx or Apache access logs into CSV or TSV.
- Kubernetes
Multi-doc manifests, structural validate, Ingress/Deployment starters, and Helm values formatting.
- Networking / IP
Subnet calculator, IP converter, range to CIDR, CIDR summarize and IP-in-subnet checks for IPv4 and IPv6, in your browser.
- Security & tokens
Inspect JWKS, verify JWTs, decode X.509 certificates, convert PEM and JWK, scan text for secrets and hash with bcrypt in your browser.
- API & schemas
Format, validate, lint and convert OpenAPI, JSON Schema and GraphQL SDL in your browser.
- HTTP Tools
Paste cURL commands, HTTP messages, URLs, HAR files and Cookie or Set-Cookie headers to format and inspect them. Nothing is sent.
- SEO / Web Tools
Generate meta tags, Open Graph, Twitter Card, robots.txt, sitemap.xml and JSON-LD in your browser. Previews come from your input, and your site is never fetched.
- Developer utilities
Timestamps, UUID, ULID, Nanoid, cron, passwords, regex, slugs, number bases, letter case, text diff, chmod and Lorem Ipsum, all in your browser.
- Text & Markdown
Count words, build Markdown tables of contents, turn CSV into Markdown tables and sort or deduplicate lines in your browser.
- AI & LLM
Count tokens, estimate API costs, check context-window fit, convert JSON to TOON and analyze prompts, all in your browser.
- Test Data
Dummy names, emails, phone numbers, addresses, dates, IBANs, card numbers and JSON, CSV or SQL rows for fixtures and database seeds. Everything is generated in your browser.
- Barcode labels
Draw Code 128, EAN-13 and UPC-A labels and static QR codes in your browser, then download PNG or SVG. This is not a GS1 lookup.