1001Ferramentas
🌐 Converters

CSV → HTML Table

Convert CSV into a semantic HTML table with <thead> and <tbody>, escaping special characters. Optional custom CSS class.

HTML:

Pasted spreadsheet, table ready to ship

You have forty rows of a spreadsheet and you need them on a page, in an email, or inside a CMS that only takes HTML. Typing tr and td forty times is the kind of chore nobody should do by hand. Paste the CSV and get back a table with separate thead and tbody, indented and ready for your template. The field ships with a filled example so you can see the output shape right away.

The first line always becomes the header. The parser follows RFC 4180 quoting, so Rio, RJ inside quotes stays a single cell, and two consecutive quotes collapse into one literal quote in the text. Ampersands and angle brackets are escaped, so a cell with a tag typed inside it shows up as text in the table instead of turning into markup and breaking the table around it. Fully empty lines are dropped.

The separator is hardcoded to a comma. Excel in locales that use a decimal comma, Brazil included, saves CSV with semicolons, so convert before pasting. Be careful replacing ; with , in a text editor: cells that already contain a comma have to be quoted, otherwise the column splits in half. Rows with fewer fields than the header are not padded, they come out with fewer td and the table goes crooked.

Frequently asked questions

Does it handle semicolon-separated files?
No, commas only. Convert the separator first, watching out for cells that already contain a comma inside the text, which need quotes around them.
Can I get a table with no header row?
The first line always becomes the thead. If your CSV has no header, convert it anyway and move that row into the tbody in the output.
Do accented characters need HTML entities?
No. Sao Paulo comes out with its accents untouched and works on any UTF-8 page. Only ampersands and angle brackets are escaped, since those are the ones that would break the markup.

Related Tools