Format JSON, YAML, TOML & XML

Paste your text, pick a format, copy the result back out neatly indented. If the input is broken, the formatter shows you exactly where it breaks and what was expected there. Everything runs locally in your browser – your data never leaves your device.

Format
Settings

Everything runs locally in your browser – nothing is uploaded.

What the formatter keeps – and what it changes

Formatting means changing the presentation, not the content. That is why commentssurvive – in YAML and TOML anyway, and in JSON as soon as you enable “Allow comments & trailing commas” (JSONC). Your number literals are left alone too: 1.50 does not become1.5, and 1e3 does not become 1000. In XML, comments, CDATA sections and the difference between <a/> and <a></a> are preserved.

Only indentation, line breaks and spacing change – plus whatever you explicitly ask for in the settings, such as sorting keys alphabetically or minifying JSON.

Understand syntax errors instead of hunting for them

Most parsers report nothing but “unexpected token” and a line number. This formatter shows the relevant excerpt with line numbers instead, underlines the exact position, lists the characters that would be allowed there and – for unclosed brackets or tags – the line where the matching opening bracket sits. One click jumps straight to the position in your input.

Per-format settings

Every format has its own rules, so the settings change with your selection: JSON offers indentation, sorting, minifying and JSONC input; YAML adds line width, quoting style and list indentation; TOML lets you align equals signs and enforce blank lines before table headers; XML covers attribute wrapping and self-closing empty elements. Your choices are stored locally and restored on your next visit.

FAQ

Is my data uploaded anywhere?
No. Formatting runs in your browser's JavaScript – there is no server round-trip and nothing is cached. Only your settings are remembered, never the text you enter.

How is this different from the converter?
The converter turns one format into another. The formatter leaves the format as it is and only fixes the way it is written.

Are there size limits?
Only the ones your browser imposes. Very large files may take a moment to process.