Format JSON instantly
Paste JSON, optionally sort keys, choose indentation, then copy output

A JSON prettifier takes JSON input and outputs the same data with consistent whitespace, line breaks, and indentation. This makes it easier to read, review, and copy into tools.
Why this tool is safe
If you want to transform formats instead of just formatting, try JSON to YAML or YAML to JSON.
Paste JSON
Paste JSON into the left box. The tool validates as you type.
Choose formatting options
Turn on Sort keys to make object key order stable, and select an indentation level.
Copy the output
Use the copy button on the right to copy the formatted JSON.
A quick mental model
Indentation controls how many spaces are added per nesting level. If your indent size is , a line at depth is indented by spaces.
Example 1: Basic formatting
Input:
{"b":2,"a":1}Output (indent = 2, Sort keys on):
{
"a": 1,
"b": 2
}Example 2: Nested objects
Sort keys applies at every object level, not just the top.
{"z":1,"obj":{"b":2,"a":1}}Use Sort keys when you want stable, predictable output.
Key sorting is especially useful when your source JSON comes from systems that do not preserve object key order.
The tool parses your JSON into a JavaScript value, optionally sorts all object keys (deeply), then stringifies it with your chosen indentation.
Mapping
JSON is a text format defined by a strict grammar. Many tools accept JSON-like variants. If your snippet has comments or trailing commas, you may still be able to format it, but you should confirm what your target system accepts.
Does sorting keys change my data?
It changes the textual order of object keys, but not the underlying key/value pairs.
Why is my JSON reported as invalid?
Common causes include missing quotes around keys, trailing commas in strict JSON, or unmatched braces.
Formatting is not validation for business rules
This tool checks syntax. It does not verify schema rules (required fields, ranges, or types beyond basic JSON parsing).
Helpful specs and docs
Parse and decode your JSON Web Token (JWT) and display its content. All computation runs locally in your browser.
Edit rich text in a simple WYSIWYG editor and copy Prettier-formatted HTML instantly. Runs locally in your browser.
Parse, validate, and format phone numbers. Get the country, calling code, type, and common formats like E.164 and RFC3966. Runs locally in your browser.
Verify the signatures of a PDF file locally in your browser and inspect certificate details. No data is sent to any server.
Convert fractions to percentages and vice versa instantly
Convert grams to tablespoons for any ingredient instantly. Perfect for cooking and baking with support for multiple ingredients.