JSON Formatter

Format, validate, and pretty-print minified JSON instantly in your browser. Spot syntax errors, compare JSON blobs field by field, and clean up JSON copied from an API, .env file, or PDF without sending any data to a server.

Output

Recent conversions

No saved conversions yet.

Usage examples

Reading a minified API response

Got a server response squeezed onto one line? Paste it in and see it instantly indented so you can read the structure at a glance.

Finding a syntax error in a config file

Not sure where your JSON config broke? Paste it in and the error message points to exactly where parsing failed.

Minifying JSON before sending it

Need the smallest possible payload? Switch to the Minify tab to strip all line breaks and whitespace.

Double-checking a .env or config value pasted as JSON

Pasted a JSON blob from a teammate's Slack message? Format it to confirm it parses cleanly and spot any stray trailing comma or unescaped quote before you drop it into your codebase.

Comparing two JSON blobs field by field

Format both a before and after version of the same object so matching keys line up on the same indentation level, making it much easier to eyeball which values actually changed.

Cleaning up JSON copied from a PDF or email

Text copied from a PDF report or email often carries smart quotes or odd whitespace. Paste it in — if it still parses as valid JSON, formatting normalizes the spacing and quote style for you.

Frequently asked questions

Is the JSON I paste sent to a server?

No. All parsing and formatting happens entirely in your browser and is never sent to a server.

Where is what I typed saved?

Only in your browser's local storage (localStorage). Revisiting the page restores your input, output, and recent conversion history, so you can easily reuse JSON you converted earlier. It's not shared across devices or browsers, and you can clear your history at any time.

How many recent conversions are kept?

Up to 20. Older entries are automatically dropped once the limit is reached.

How will I know if my JSON is invalid?

An error message appears below the input, telling you where parsing failed.

Does this accept trailing commas or comments like JSON5 or JSONC?

No. This uses the browser's built-in, strict JSON parser, so trailing commas, `//` or `/* */` comments, and unquoted keys are all rejected as syntax errors — exactly as they would be by `JSON.parse` in any JavaScript environment. Strip comments and trailing commas before pasting if your source uses a relaxed JSON dialect.

Will large numbers lose precision?

Yes, if they exceed what JavaScript's number type can represent exactly (integers beyond about 9007199254740991). This is a limitation of JSON parsing in JavaScript generally, not something specific to this tool — large IDs or 64-bit values from other languages can come out rounded. Keep such values as strings in your JSON if exact precision matters.

Does formatting change the order of keys in an object?

No. Key order is preserved exactly as it appeared in your input; formatting only adds indentation and line breaks, it never reorders, adds, or removes any keys or values.