WebToolsPlanet
Converter Tools

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

Client-Side Processing
Input Data Stays on Device
Instant Local Execution

Find this tool useful? Support the project to keep it free!

Buy me a coffee

What 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

1

Choose the source: tables or lists.

2

Paste HTML containing the source elements.

3

The YAML output appears instantly.

4

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.

HTML input
<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>
YAML output
- Name: Alice
  Role: Admin
- Name: Bob
  Role: User

Privacy

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.