HTML Table to YAML Converter
Turn a published table into a config file. One mapping per row, one type per column, and every value a YAML reader would misread comes back quoted.
To convert an HTML table to YAML, paste the markup above. Every table on the page is listed; the one you pick becomes a YAML sequence of mappings keyed by its header cells, with a type decided once per column. Empty cells become null, and any value a YAML reader would coerce, dates and padded codes among them, is quoted so it survives.
Want to drop a column before you generate the file? Open the app
Published tables that become configuration
The pattern shows up wherever an external body publishes something your system has to honour. Rate limits per plan, region identifiers, currency codes, supported browser versions, retention periods per jurisdiction. It is on a page, and it needs to be in a file your application reads.
YAML is usually the destination because the file will be reviewed. A pull request that changes three lines of YAML is legible; a pull request that changes three lines of a JSON blob is legible too but nobody enjoys it, and a change to a binary is invisible.
Worked example
A published table with the hazards YAML cares about:
<table>
<tr><th>country</th><th>code</th><th>effective</th><th>rate</th><th>notes</th></tr>
<tr><td>Norway</td><td>no</td><td>2026-01-01</td><td>25</td><td></td></tr>
<tr><td>Sweden</td><td>se</td><td>2026-01-01</td><td>25</td><td>reduced band applies</td></tr>
</table>
And the YAML:
- country: Norway
code: 'no'
effective: '2026-01-01'
rate: 25
notes: null
- country: Sweden
code: se
effective: '2026-01-01'
rate: 25
notes: reduced band applies
This is the Norway problem in its natural habitat. Norway's country code is no, and unquoted in YAML 1.1 that is the boolean false. Sweden's se is unambiguous and stays bare. Two adjacent values in the same column, quoted differently, and both correct: quoting is decided per value from what that exact text would resolve to.
Everything that gets quoted, and why
- Boolean-like words.
no,yes,y,n,on,off. Country codes, checkbox columns and single-letter statuses all land here. - Number-like text.
01730loses its zero,1.10becomes 1.1,1e5becomes 100000,+44becomes 44. - Dates. A bare ISO date is a YAML 1.1 timestamp, so a config that expected a string gets a date object.
- Null-like text. A bare
~, and the word null typed as data. - Nothing else. A file where every value is quoted is a file nobody proofreads, and being readable is the reason to choose YAML at all.
Types, spans and blanks
A column becomes numbers only when every value in it round trips exactly, decided once for the whole column. That is what prevents a list where one entry's rate is a number and the next one's is a string, which is a config that fails on the fourth country rather than the first.
An empty cell becomes null rather than an empty string. In configuration that distinction usually decides whether a default applies, which makes it the one place where being pedantic pays off immediately.
Merged cells are resolved before any of this happens. A rowspan that is ignored leaves a row short, and a short row in YAML becomes a mapping missing a key, which is a config that silently loses a setting for one entry.
Keys, and what happens to a header written for a reader
The keys are the header cells exactly as the page wrote them, capitals and spaces included. That is deliberate: a header is a label somebody chose, and normalising it into snake case is a decision with four reasonable answers and no way for a converter to pick the one your loader wants.
A header with a space in it produces a YAML key with a space in it, which is legal and which most loaders handle. If yours does not, renaming the columns in the full editor before you convert takes less time than fixing the file afterwards, and the escape-hatch link above the fold goes straight there.
Duplicate headers are renamed rather than dropped: a second column called total becomes total_2, with a note. Left as they were, the second would overwrite the first when the row became a mapping, and a mapping cannot hold the same key twice.
The shape, and what is not added
The output is always a flat sequence of mappings. No top-level key wrapping the list, no grouping by one of the columns. Both are guesses about your consumer, and adding a wrapping key by hand takes two seconds while unpicking a wrong guess does not.
Nothing is stamped into the file. Two of the free converters on this term add a generated-by comment to every YAML they write, one of them with no way to switch it off, which then lives in your repository indefinitely.
Frequently Asked Questions
Why is the code for Norway in quotes and the one for Sweden not?
Because no unquoted in YAML 1.1 is the boolean false, and se is unambiguous. Quoting is decided per value from what that exact text would resolve to, which is why two values in one column can be quoted differently and both be right.
Are dates quoted?
Yes. A bare ISO date is a YAML 1.1 timestamp, so a loader hands your code a date object where the config said a string. Quoting keeps it a string, which is almost always what a config file means.
What do empty cells become?
Real nulls, not empty strings. In configuration that difference usually decides whether a default applies, so it is one of the few places where the pedantic answer prevents an incident.
How are merged cells handled?
Resolved into a full rectangle before typing. A rowspan left unresolved produces a short row, and a short row in YAML is a mapping missing a key, which quietly drops a setting for one entry rather than failing loudly.
Can I wrap the list in a top-level key?
Not as an option. The output is always a flat sequence of mappings, which is what most loaders expect and what our YAML to CSV tool reads back. Adding a key and indenting is a quick edit; a wrong guess is not.
Is a comment added to the file?
No. Nothing is inserted into your output. Some free converters stamp a generated-by line into every YAML they produce, and only one of those offers a way to turn it off.
Turn the published table into a config file
One mapping per row, one type per column, quotes exactly where a parser needs them.
Back to the converter