HTML to YAML

Convert an HTML table into YAML.

0 chars
0 words
0 lines
0 chars
0 words
0 lines

HTML Table to YAML Converter Online

The HTML to YAML converter takes a table from HTML and writes it as a readable YAML list. YAML is the format of choice for static site generators (Hugo, Jekyll, Eleventy data files), Ansible variables, and CI configurations, so this tool is a shortcut from "a table I found on a page" to "a data file my build can use".

From rows to records

Each <tr> of the chosen table becomes one YAML item, and each header cell becomes a key:

- Plan: Starter
vCPU: 1
RAM: 2 GB

With Detect numbers & booleans, numeric cells and true/false are written unquoted so they load as real numbers and booleans; values such as 2 GB or €5.00 remain strings. Turn the option off if everything should be text. Dot headers → nested maps groups columns named like specs.cpu and specs.ram into a nested specs mapping.

Picking the right table

Paste a snippet or a full page source — every <table> in it is detected, including nested ones, which are numbered as separate tables. Enter the table number to select one; the preview underneath shows the extracted rows and the caption. Header handling can be automatic (<thead> or <th> cells), forced to the first row, or disabled.

Clean values

Markup inside cells is reduced to text, line breaks and repeated whitespace collapse to single spaces, and entities like &amp; or &#169; are decoded. Cells merged with colspan leave the following columns empty, while rowspan repeats the value in each covered row so no record is missing data.

Typical uses

Copy a feature comparison into a Hugo data/ file, build an Ansible inventory from an HTML report of servers, or turn a documentation table of settings into a defaults file. Nothing is uploaded — the whole conversion runs locally in your browser.

Validate or reformat the output in the YAML Validator, convert it further with the YAML Converter, or extract the same table as JSON, XML, or CSV.

Frequently Asked Questions

A sequence of mappings: each table row starts with “- ” and lists header: value pairs. Quotes are added only where YAML needs them — for example empty values, or text that would otherwise be read as a number, boolean, or special syntax — so the output stays valid and readable.

If the table headers are paths like server.host and server.port, the option groups those columns into a nested server: mapping in every record. Ordinary headers are unaffected.

Empty cells — including the extra columns covered by a colspan — become "" so every record has the same keys. That keeps the YAML predictable for templates and loaders that expect a fixed shape.