JSON Formatter & Validator
Paste raw or messy JSON and instantly pretty-print it with two-space, four-space or tab indentation, sort every object's keys alphabetically for stable diffs, or minify it down to a single compact line for transport. The formatter validates as it goes: if the input isn't valid JSON it points to the problem instead of producing silent garbage. It handles deeply nested structures, arrays, Unicode and large documents, all in your browser — your data is never uploaded, which matters when the JSON holds API responses, tokens or personal records. Use it to clean up logs, prepare test fixtures, or make an API payload readable.
How to use
- Paste or type your JSON into the input area.
- Choose an indentation size and, optionally, sort keys alphabetically.
- Click Format to beautify, or Minify to compact the JSON.
- If the JSON is invalid, the error message points to the problem.
- Copy the formatted result with the Copy button.
Frequently asked questions
- Is my JSON sent to a server?
- No. All formatting and validation happens locally in your browser — nothing is uploaded.
- What does sorting keys do?
- It reorders every object's keys alphabetically, recursively, which makes diffs and comparisons easier.
- Why do I get a syntax error?
- The input isn't valid JSON. Common causes are trailing commas, single quotes, or unquoted keys.
- Does minify change my data?
- No. Minify only removes whitespace; the data and key order stay the same unless you also enable sorting.
- What indentation options are there?
- You can pretty-print with 2 spaces, 4 spaces or tabs, or minify to a single line with no whitespace. Two-space indentation is the most common convention for configuration files and API examples.
- Does sorting keys work on nested objects?
- Yes — sorting is applied recursively, so every object at every level has its keys ordered alphabetically. This produces a canonical form, so two JSON documents that differ only in key order can be compared as identical.
Guides on this topic
- Why In-Browser Tools Keep Your Data Private How client-side tools work, why running entirely in your browser means your data never leaves your device, and how to verify that claim yourself.
- Why numbers change when they pass through a program 0.1 plus 0.2 comes out as 0.30000000000000004, a long ID loses its last digits, and a total is a cent off. Almost all of it comes from one design decision: numbers are stored as binary fractions with a fixed budget of bits.
Related tools
XML Formatter & Minifier
Beautify XML with clean indentation or minify it to one line, in your browser.
YAML Formatter & Validator
Pretty-print and validate YAML — fix indentation, sort keys, choose line width, catch errors in place.
SQL Formatter
Format and beautify SQL across 10 dialects (PostgreSQL, MySQL, BigQuery, Snowflake, T-SQL …).
Column Aligner — Align Text into Columns
Pad whitespace, comma or tab separated rows into neatly aligned columns, in your browser.
HTML / CSS / JS Minifier
Strip whitespace and comments from HTML, CSS, or JavaScript — see the size saved and copy the result.
JSONPath Tester
Run JSONPath queries (`$.store.book[*].author`, `$..price`) against a sample document and see the matching values.