Why a YAML formatter needs a safety check
Most formatters load YAML into a JavaScript object and print it back out. That throws away comments, expands anchors, and lets a quoted "no" or '0123' turn into a boolean or a number. FormatYAML edits the document model instead: the same nodes, the same scalar styles, the same comments, only re-laid out.
After formatting, the output is parsed again on its own and the two representation graphs are compared: types, exact values (including integers beyond 2^53 and long decimals), tags and alias identity. If anything differs, Apply is blocked. If the checker cannot prove equality — duplicate keys, for instance — it says “unverified” instead of “equivalent”.
What you can do here
Paste or open a file, pick a YAML profile (1.2 core by default, or 1.1 legacy), choose a preset, and review the preview, the exact line diff and the checks. Apply commits the result as one undoable step. Download gives you the formatted file, a patch, or a JSON report with the engine version, profile and options used.
The Types tab lists every scalar with its written form and resolved type side by side, and flags values that YAML 1.1 tools read differently. The Invisible tab shows tabs, no-break spaces, zero-width and bidirectional control characters without deleting anything.
Questions
- Is my YAML uploaded anywhere?
- No. Parsing, formatting, checking and conversion run in your browser, in a Web Worker. There is no server-side processing and no analytics on content. Drafts are kept in your browser’s IndexedDB unless you switch on private mode.
- Will formatting remove my comments?
- No. Comments are kept. If a style choice cannot keep a comment (for example converting a commented block list into a one-line flow list) the operation is blocked and the comment is named. When a comment moves to a different line, the Checks tab lists it.
- What does “unverified” mean?
- The checker could not prove the output means the same as the input — usually because the input has duplicate keys (which YAML forbids) or the graph is too large for the comparison budget. You can still apply after confirming you reviewed the diff.
- Does it support multiple documents and directives?
- Yes. %YAML and %TAG directives, --- and ... markers, document order and empty documents are kept.