FormatterHQ

HTML Table to YAML Converter

Turn an HTML table into a YAML list of records, ready for a static site data folder, test fixtures or configuration. Choose 2 or 4 space indentation and optional key sorting.

Input HTML
Output YAML
Ready.

How to use the HTML Table to YAML Converter

  1. Paste the HTML that contains the table, upload an .html file, or use Load URL.
  2. Keep First row is header on so the column headings become YAML keys.
  3. Choose Detect numbers & booleans, an Indent of 2 or 4 spaces and, optionally, Sort keys.
  4. Click Convert to YAML, then copy the output or download a .yaml file.

HTML to YAML for data files

Static site generators, documentation tools and many test setups read structured data from YAML files: a team page, a list of events, a glossary, a set of fixtures. When that data already exists as a table in an old page or a CMS export, this html to yaml converter turns it into a YAML sequence of mappings, one entry per row, with the column headings as keys.

The output is plain YAML that any parser can read, with one entry per row that you can drop into a data folder and loop over in a template.

Example: a team table

<table>
  <tr><th>Name</th><th>Role</th><th>Profile</th></tr>
  <tr><td>Priya Shah</td><td>Editor</td>
      <td><a href="https://example.com/priya">priya.dev</a></td></tr>
  <tr><td>Tom Reyes</td><td>No</td><td></td></tr>
</table>

converts to:

- Name: Priya Shah
  Role: Editor
  Profile: priya.dev
- Name: Tom Reyes
  Role: 'No'
  Profile: ''

Two details are worth noticing. The link was reduced to its visible text; the URL in href is not kept, so add it back by hand if your template needs it. And the value No was written in quotes. Some YAML parsers, following the older YAML 1.1 rules, read an unquoted No, Yes, On or Off as a boolean, so the converter quotes such strings to make sure they stay text. Empty cells become ''.

Options

  • First row is header – headings become keys; blank ones become column1-style names by position and repeated ones get _2. Unticked, each row is written as a YAML list of values.
  • Detect numbers & booleans – writes 24.99 and true unquoted as numbers and booleans. When off, every value is a string, and strings that look like numbers are quoted, for example Price: '24.99'.
  • Indent – 2 or 4 spaces for nested entries.
  • Sort keys – orders the keys of each entry alphabetically instead of following the column order.

Multiple tables and keys with spaces

If the page contains several top-level tables, the YAML becomes a mapping with one list per table, keyed by the table's id or by table1, table2 and so on. Keys that contain spaces, such as In stock, are valid YAML and stay as written, but templates often access them more easily when you rename the heading to in_stock before converting.

Check the file with the YAML validator before committing it, or convert the same table with HTML to JSON if your tooling expects JSON data files. For converting YAML onward, YAML to JSON is available as well.

Privacy

The table is parsed and converted in your browser. Only Load URL (fetched through our server) and Save & Share (stored for the link) involve our server.

Frequently asked questions

Why is a value like No or Yes quoted in the YAML?
Under YAML 1.1 rules, unquoted words such as yes, no, on and off can be read as booleans. Quoting them keeps them as text in every parser.
Can I keep the links from the table?
No. Only the text inside each cell is converted. Add URL fields by hand afterwards, or keep a separate column with the plain URL text in the source table.
Should I choose 2 or 4 spaces?
Both parse the same way. Two spaces is the common convention for YAML data files, but match whatever the rest of your project uses.
Why are my numbers quoted?
That happens when Detect numbers & booleans is off: values stay strings, and strings that look like numbers must be quoted to stay strings. Turn the option on to write them as numbers.

Last updated September 26, 2026

Related tools