fileview.dev

JSON formatter and beautifier

Paste minified JSON and get it back indented and readable, minify it again when you need it small, or repair the near-misses — trailing commas, unquoted keys — with the repair reported rather than applied silently.

Format JSONNothing uploaded. No signup.

Format, minify, repair

Format
One long line becomes indented, readable text. Indentation follows your tab-size setting, and the transform goes through the editor’s undo stack so one Ctrl+Z puts it back exactly as it was.
Minify
Every byte of insignificant whitespace removed, for when the JSON is going into a request body or an environment variable.
Repair
Trailing commas, unquoted keys, single-quoted strings and comments are all things JSON forbids and people write anyway. Repair fixes them and tells you what it changed — "removed 2 trailing commas" — rather than quietly rewriting your file.

Formatting does not change your data

It only changes whitespace between tokens. Values, key order and types are untouched, so a formatted file is byte-for-byte equivalent to a parser. Repair is different — it changes the text so that it parses — which is why it is a separate action that reports itself.

Very large files

Above roughly 2 MB the editor drops features it cannot afford at that size — the minimap first, then syntax highlighting — so formatting a large file leaves you with something that still scrolls. Beyond a few hundred megabytes, jq . on the command line is the better tool, because it streams instead of holding the document in memory.

Format JSON

Questions

How do I format JSON online?

Paste it into fileviewer.dev or drop the file onto the page, then use Format from the toolbar or the command palette. The document is re-indented in place, and Ctrl+Z reverts the whole transform in one step.

Does formatting change my data?

No. Formatting only alters whitespace between tokens — values, types and key order are untouched. Repair is a separate action, because it does change the text, and it always reports what it changed.

Can it fix invalid JSON?

It can fix the near-misses: trailing commas, unquoted keys, single-quoted strings and comments. It reports each repair rather than applying it silently. Something genuinely malformed — a truncated file, a missing brace deep in a structure — needs a person, and the error is underlined at the position where the parser gave up.

Is my JSON uploaded to be formatted?

No. Formatting, minifying and repairing all happen in your browser. Nothing is transmitted, which you can confirm by using the tool with your network disconnected.