CSV to HTML Table
Convert CSV into HTML table markup with thead, tbody and escaped cell text. Choose whether the first row is a header and how to indent, and check the result in a live preview.
Use the tool
Why this tool exists
Publishing tabular data on a web page means writing a lot of repetitive markup: a tr for every row and a td for every cell, each with correct escaping. Copying from a spreadsheet gives you messy code, and typing it yourself is slow.
Paste your CSV and get a clean table with a header section and body, indented the way you prefer. Characters such as & and < in cells are escaped so they show as text instead of breaking the page. The live preview shows how the table looks with basic borders, so you can check column order before pasting into your CMS. The markup is plain, with no classes or inline styles, so your own stylesheet controls the look. Everything runs in your browser.
How to use it
- Paste your CSV into the input box.
- Choose the delimiter, or leave it on auto.
- Tick First row is header to use th cells inside thead, and choose the indent.
- Check the preview, then copy the HTML table.
Frequently asked questions
Is the output styled?
No. It is plain table markup. The preview uses simple borders only so you can see the layout. Add your own CSS classes or styles on your site.
Are special characters escaped?
Yes. Ampersands, angle brackets and similar characters in cells are converted to entities so they display as text rather than being read as HTML.
What if my CSV has no header row?
Untick the header option. Every row, including the first, is then written as td cells inside tbody, and no thead section is created in the markup.
Is the table accessible?
Using th for headers and thead for the header row is the basis of an accessible table. For complex tables you may still want to add a caption and scope attributes yourself.