HTML to YAML Converter
Paste HTML containing tables or lists and get structured YAML — tables become lists of objects, and nested lists preserve their tree shape.
Last updated: May 26, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is HTML to YAML Converter?
HTML tables and lists encode structured data, but the markup is verbose and hard to parse with anything except a DOM library. YAML is a much more concise human-readable format that maps naturally onto both shapes: a table becomes a list of objects keyed by the column headers, and nested `<ul>`/`<ol>` lists become nested YAML lists.
This converter uses the browser's DOM parser to walk the HTML, detect tables or lists, and emit clean YAML. Column headers (from `<thead>` or `<th>` cells in the first row) become object keys. Cell values are quoted where YAML would otherwise mis-parse them (booleans, numbers, special characters). For lists, the tree structure is preserved with indentation.
How to Use HTML to YAML Converter
Choose the source: tables or lists.
Paste HTML containing the source elements.
The YAML output appears instantly.
Copy the YAML or download it as a .yaml file.
Common Use Cases
- Migrating data from an HTML data table into a YAML config file.
- Extracting Wikipedia-style HTML tables into structured YAML for processing.
- Converting an HTML outline (nested ul/ol) into YAML for use in a static site generator.
- Importing tabular HTML data into a tool that expects YAML input.
- Quickly producing a YAML fixture for tests from an HTML mock.
Example Input and Output
An HTML table with two columns becomes a YAML list of two-key objects.
<table>
<tr><th>Name</th><th>Role</th></tr>
<tr><td>Alice</td><td>Admin</td></tr>
<tr><td>Bob</td><td>User</td></tr>
</table>- Name: Alice
Role: Admin
- Name: Bob
Role: UserPrivacy
All conversion happens in your browser. No HTML or YAML is sent to a server.
Multiple tables
If your HTML contains multiple tables, each is emitted as its own YAML block with a comment header (# Table N) separating them.
Frequently Asked Questions
What does the tool do if there are no headers?
If the table has no <th> cells in the first row and no <thead>, each row is emitted as a YAML sub-list of values rather than an object. You can also use the lists mode if that fits your data better.
How are special characters in cell values handled?
Values that look like YAML booleans (true, false, yes, no), numbers, or contain reserved characters (: # & * !) are wrapped in double quotes to prevent mis-parsing.
Does this support nested tables?
Cells inside the rows are read as plain text — nested tables inside a cell become a single concatenated string, not a nested object. If you need nested structure, the lists mode is a better fit.
Does this send my HTML anywhere?
No. The DOM parser runs in your browser. Nothing is uploaded.
Related Tools
HTML to JSON Converter
Convert HTML tables, lists, or DOM trees to JSON. Extracts structured data from HTML without writing a parser.
HTML to CSV Converter
Extract table data from HTML and convert it to CSV. Supports multiple tables, minimal or always-quote modes, and download as .csv.
HTML to XML Converter
Convert HTML to well-formed XML. Closes void elements, lowercases tags, escapes attributes, and adds an optional XML declaration.
HTML to TSV Converter
Extract HTML <table> data into tab-separated values (TSV). Choose the first table or all tables, copy or download the TSV output.
YAML to JSON Converter
Convert YAML to JSON and JSON to YAML — for config files, CI pipelines, and Kubernetes manifests.
YAML Beautifier
Format and prettify YAML with configurable indentation and optional key sorting. Validates YAML syntax instantly.

