Skip to content
hateitall

YAML Formatter and Validator

Find the indentation slip in a config file and get back consistently indented YAML.

Processed locallyIn: YAMLOut: YAML, JSON

Loading tool…

How to use yaml formatter and validator

  1. Paste YAML or open a .yaml or .yml file.

  2. Read the error with its line and column if there is one, and fix it.

  3. Choose 2 or 4 spaces, key sorting and block style for long text.

  4. Copy or download the formatted YAML, or switch to the JSON view.

What this tool does

  • Explains common mistakes in plain words: tabs used for indentation, duplicate keys, a colon inside an unquoted value, unclosed quotes and brackets.
  • Normalises mixed indentation and flow style into clean block YAML.
  • Counts keys, list items and nesting depth.
  • Handles several documents separated by ---.

How the result is verified

The formatted YAML is read back and compared with the original data value for value; if anything differed you would see a warning instead of the tick.

Frequently asked questions

Why does it say tabs are not allowed?

YAML forbids tab characters for indentation. Replace the tab at the start of the reported line with spaces; tabs inside values are fine.

Will formatting change my data?

No values change. Layout, quoting style and key order (if you sort) can change, and comments are removed, which the page tells you when your input has them.

Is my data uploaded to a server?

No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.

Convert YAML to JSON and JSON to YAML, with line-numbered errors

YAML · JSON→ JSONLight on device

Readable YAML from JSON, with ambiguous values quoted safely

JSON→ YAMLLight on device

Beautify or minify JSON with your choice of indentation

JSON→ JSONLight on device

Pretty print or minify XML, checked by re-parsing

XML · SVG · RSS→ XMLLight on device

Readable SQL with clauses, joins and subqueries laid out

SQL→ SQLLight on device