01 / Check
Errors with a place
The text is read as you type. A mistake is shown with its line and column, a plain explanation, and the lines around it.
Free tool
Paste YAML or open a file. It is checked as you type, and a mistake shows its line and column in plain words. Format it with 2 or 4 spaces, sort the keys, or squeeze it into flow style. Comments, anchors, aliases and several documents in one file are kept, and numbers stay exactly as you wrote them. Turn it into JSON, turn JSON into YAML, or browse it as a tree with paths. Nothing is uploaded.
This file is big, so it is kept out of the text box to keep the page quick. The result is on the right.
The formatted YAML shows here.
Paste on the left, open a file, or press Example.
Options
Keys
Your YAML is read in your browser. It is never uploaded or saved, so keys and passwords in config files stay with you. Only your settings are remembered on this device.
How it works
01 / Check
The text is read as you type. A mistake is shown with its line and column, a plain explanation, and the lines around it.
02 / Format
Indent, line width, key order and brackets change. Comments, anchors, aliases, quotes and numbers stay as you wrote them.
03 / Convert
See the same data as JSON, as one line of flow style, or as a tree with the path of every key.
Guide
A YAML formatter rewrites a YAML file with steady indentation and spacing, and tells you if the file is not valid YAML. This one keeps your comments, anchors, aliases, tags and quote marks, shows the line and column of every mistake, and can turn the same data into JSON, or JSON into YAML. It reads YAML 1.2 by default and has a switch for the older 1.1 rules.
| Stays as you wrote it | Can change |
|---|---|
| Comments and blank lines (while Keep comments and Keep blank lines are ticked) | The spaces before a comment shrink to one |
Anchors (&name), aliases (*name), merge keys (<<) and tags such as !Ref | Spaces inside [ ] and { }, as the option says |
| Each string's quote marks, and numbers such as 0755, 1.50, +5 and 0x1F | Indentation, and whether lists sit under their key |
| The order of keys, and several documents separated by --- | Long plain strings wrap at the line width, and folded > text is re-flowed |
Wrapping changes how the text is laid out, not the value: YAML reads the wrapped line back as one line. Choose No wrapping if you would rather it never wraps.
A number that must not change. In a Kubernetes file, value: 0755 is printed as 0755. The JSON view reads it by YAML 1.2, where it is the number 755. With YAML version 1.1 it is an octal number, 7 × 64 + 5 × 8 + 5 = 493.
The key called on. In a GitHub Actions workflow, on: is the key that holds the triggers. Under YAML 1.2 it is the text on, and the JSON view shows "on". Older YAML 1.1 readers, such as PyYAML, turn it into true.
Four real files. A Docker Compose file, a GitHub Actions workflow, a Kubernetes manifest with two documents and an OpenAPI file were formatted with every combination of indent 2 or 4, line width 80, 120 or none, lists indented or not, brackets padded or not, and as written, block or flow style. That is 72 results for each file, and reading each result back gave the same data as the original every time. The JSON view of all four matched what ruamel.yaml's YAML 1.2 reader gives. PyYAML differed on two of them, on and 0755.
Flow style. The 874 byte compose file becomes one line of 688 bytes, the 946 byte OpenAPI file one line of 764 bytes. Comments are dropped in flow style, since a comment cannot sit inside a single line.
Matching a list style. The Kubernetes sample writes - name: at the same column as its key. With Indent lists under their key ticked, 17 of its 43 lines change. Untick it and none do. The compose file and the OpenAPI file indent their lists, so the tick matches them.
Where the rules come from. The YAML 1.2 rules for true, false, null and numbers are in the YAML 1.2.2 specification, section 10.3 (core schema): only true and false are booleans, and an octal number is written 0o17. The YAML 1.1 rules are on its boolean and integer pages: y, yes, on and their opposites are booleans, and a leading 0 means octal. All were read on 19 Oct 2026.
Sort keys A to Z orders every mapping, with numbers in natural order (item2 before item10) and the merge key first. An anchor must stay above the aliases that use it, so a mapping that holds an anchor is left in its own order when the file also has aliases, and the line under the boxes says how many were left.
Custom tags such as !Ref and !Sub are kept in the YAML and left out of the JSON, since JSON has no tags. A key that is itself a list is written as a string in JSON. JSON with comments or trailing commas is not valid YAML or JSON, so use the JSON formatter, which can repair it. To format XML, see the XML formatter, and to compare two versions of a file, use the diff checker.
Questions
No. It is read and written in this tab and never leaves your computer, so keys and passwords in a config file stay with you. Only your option settings are remembered, never the text.
No. Comments stay where they were. They are removed only if you untick Keep comments, and always in flow style.
It changes layout, not data. Numbers keep the text you wrote, strings keep their quotes, and a wrapped line is read back as one line. The one choice that can matter is the YAML version in the JSON view, because 1.1 and 1.2 read words like yes and on differently.
Paste the JSON and look at the YAML view. JSON is valid YAML, so it is read as it is and written in block style, one item per line. Big whole numbers keep all their digits.
Press JSON above the result. Several documents in one file become one JSON list, and merge keys (<<) are expanded.
YAML does not allow tabs for indentation, only spaces. Press Replace tabs with spaces in the error, then check the indent, since the depth of a line decides which key it belongs to.
An anchor (&name) labels a value and an alias (*name) reuses it later, so you write it once. Docker Compose files use them with the merge key << to share settings.
They read some plain words differently. In 1.1, yes, no, on and off are booleans and 0755 is an octal number. In 1.2 they are text and a plain number. Most tools today follow 1.2, and some older ones follow 1.1.