JSON Formatter Converter

Pretty-print and validate JSON with useful error messages.

Runs in your browser Free · no accountFile upload supported

JSON

Formatted JSON

This conversion happens locally in your browser. Your files are never uploaded.

About the JSON Formatter converter

Paste minified or badly indented JSON and get it back readable. If the document does not parse, you get the line number and the surrounding text rather than a character offset you have to count to.

It doubles as a validator: if the output panel fills in, your JSON is well-formed.

Reading the error messages

Browsers report JSON syntax errors as a character position, which is useless when you are looking at a 4,000-line file. This formatter converts that offset into a line number and shows the text around it.

The usual culprits are a trailing comma after the last item, single quotes instead of double, and an unquoted key. None of those are legal JSON even though most JavaScript engines accept them in source code.

Sorting keys

Sorting keys alphabetically makes two versions of the same document diff cleanly, which is the fastest way to see what actually changed between two API responses.

It does change the document, so do not sort a file whose key order is meaningful — some configuration formats care.

Tabs or spaces

Two spaces is the near-universal default for JSON and what most linters expect. Tabs produce smaller files and let each reader pick their own width. Four spaces is common in Python-adjacent codebases.

Frequently asked questions

Does it accept JSON with comments or trailing commas?

No. Those are JSON5 and JSONC extensions, not JSON. Remove them and the document will parse.

Is my data sent to a server?

No. Parsing and formatting happen in your browser tab, which is why the tool is instant even on large files.

What is the largest file I can format?

Files up to several megabytes are comfortable. Beyond that your browser, not the tool, becomes the limit.