YAML formatter and validator
Paste YAML to check it and tidy it. Ctrl+C copies the result.
Private: your files never leave this deviceNothing is uploaded or stored on a serverWorks right here in your browserTidy keeps comments and writes clean blocks. Sort keys puts names in A to Z order.
Need JSON instead? Convert YAML to JSON
How to format and check YAML
Paste or open
Paste YAML into the Input pane, press Open to pick a .yaml or .yml file, or drop it on the pane. Sample loads a small trip plan.
Pick the style
Tidy writes clean block YAML with the indent you choose. Compact writes it on one line. Tick Sort keys to put keys in A to Z order. Mistakes show their line and column.
Copy or download
Press Copy, or Ctrl+C with nothing selected, to copy the result. Download saves it as a .yaml file.
Good to know
- YAML does not allow tabs for indenting. If the error mentions a tab, replace it with spaces.
- Files over 2 MB stay out of the editor; a worker reads them from disk so the page does not freeze. Only the first 1 MB of the result is drawn, Copy and Download use all of it.
- Duplicate keys in one map are reported as an error, because most programs would silently keep only one of them.
- Long text is kept on one line instead of being folded, so the file stays easy to compare.
Questions people ask
Are my comments kept?
Yes, in the normal tidy mode. Comments stay next to the line they belong to, also when keys are sorted. Compact mode writes everything on one line, so it leaves comments out.
What does the error message mean?
It names the first line and column where the YAML stops making sense. Press Go to error to jump there. The usual causes are a tab used for indenting, a missing space after a colon, or a list item that is not lined up with the others.
Can I check a file with several documents?
Yes. Documents separated by --- are each checked and tidied, and stay in the same order. The status line shows how many there are.
Does it change my values?
No. Values, quotes that matter, anchors (&name) and aliases (*name) are written back as they are. Only spacing, indent and, if you ask, key order change.
Is my file uploaded?
No. Checking and formatting run in a background worker inside your browser. Nothing is sent to a server.