Check YAML and re-indent it, sort keys and set quotes. Errors show the line and column. Nothing is uploaded.
A YAML formatter checks that the text is valid YAML and writes it again with a steady indent, one style for lists and quotes, and long text folded at a width you choose. This page does both in one step: if the YAML is valid the formatted text appears, and if it is not you get the line and column of the first problem, such as Line 6, column 3: tab characters must not be used in indentation. The text is first read as plain data under the YAML 1.2 core rules. It is then written again from its syntax tree, not from the data, so each value keeps the way you wrote it. 0x1F stays 0x1F, a 30 digit number keeps all its digits, yes stays yes, and anchors, aliases and merge keys stay as they are.
Comments do not survive. The js-yaml library this page uses does not read comments into its syntax tree, so any line or trailing text that starts with # is gone from the result. No setting can keep them, and this page cannot add them back. When your text contains a # after a space or at the start of a line, the page says so in a notice, because that may be a comment. Keep your original file if its comments matter, and copy only the layout you want from the result.
Indent is 2 or 4 spaces. Tabs are not allowed in YAML indentation, so there is no tab choice. Sort keys A to Z orders the keys of every mapping by character code, so Z comes before a. A document that uses anchors or aliases keeps its own order, because moving a key above its anchor would break the file. Indent list items off puts dashes in line with their key. Quoted text can be switched to single or double quotes, and Quote every text value wraps plain text values in quotes. For example, the lines name: web, ports: [80, 443] and a list indented 4 spaces become name: web, ports: [80, 443] and a list indented 2 spaces. With sorting on, b: 1 followed by a: 2 comes out with a first.
A YAML text can hold several documents separated by a line of three dashes. All of them are checked and formatted, kept in order and separated by ---, and the result shows how many there were. Custom tags such as !!js/function are refused with an error, and nothing in your text is run. A document may nest 100 levels deep and use up to 10,000 aliases. Duplicate keys in one mapping are reported as an error. Messages never repeat your text.
Up to 500,000 characters are handled, and above 100,000 the result follows your typing after a short pause. Long plain text is folded onto several lines past the width you pick, which does not change the value. The page does not check meaning, only YAML syntax: it cannot tell you that a Kubernetes field is misspelled. The js-yaml code is a separate download that loads when the page opens, and everything runs in this tab.
Paste it into the box. If it is valid, the page shows Valid YAML with the number of documents and the formatted text. If not, it shows the line and column of the first error, for example Line 4, column 1: duplicated mapping key.
No. Lines that start with # and comments after a value are removed, because js-yaml does not read comments into its syntax tree. A notice appears when your text has a # that may be a comment.
YAML only allows spaces to show nesting. A tab at the start of a line, often pasted from an editor set to tabs, is an error. Replace each tab with 2 or 4 spaces, keeping keys of one mapping in the same column.
Yes. Each document is checked and formatted, and they stay in order with --- between them. A notice gives the count, for example 2 documents. A leading --- on the first document is not added back.
For plain mappings no, because key order carries no meaning in YAML. Lists are never reordered. A document with anchors or aliases is left unsorted, and the notice says how many documents were skipped.
No. The text is processed in your browser and not uploaded. The YAML itself is never saved; only your option choices are kept on this device.