Code · Made a little simpler

HTML to YAML Converter

Convert a full HTML document or a fragment to YAML. Keep element order, attributes, mixed text, comments and template content, then review parser notices.

Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device
HTML parsing

Add this tool to your website

Paste this code into your page to add the tool and a visible ToolMellow credit link.

HTML embed code
Preview embed

HTML to YAML Converter: how to use it

  1. Paste or open an HTML file. Choose Full document for head and doctype data, or choose Fragment and set the surrounding element context.
  2. Choose the indentation and whether to include comments and indentation-only lines. Convert to YAML and check the counts and parser notices.
  3. Copy or download the YAML and open it with a YAML parser to inspect the nodes, attribute strings and child order.

Limits and notes

Up to 250,000 UTF-16 code units and 20,000 parsed nodes. The output records the HTML parser tree, including implied elements, normalized line endings and decoded entities. Script and style bodies stay as text. The export describes structure and retains no original attribute quoting or byte layout.

How your privacy works →

HTML to YAML Converter: common questions

Why is there a tbody that I did not type?

An HTML parser creates a table body around certain loose rows. The export marks parser-inserted elements as implied.

How can I keep a table row or cell fragment?

Select table or tbody for table markup and tr for isolated cells. Context changes which elements the HTML parser keeps.

Can I shorten the YAML without changing meaningful text?

Omit indentation-only lines to drop whitespace-only text nodes with a line break outside preformatted and raw-text elements. Keep the option off when whitespace is meaningful.

Guides