CSV to HTML Table Converter
Paste comma-separated data and get a ready-to-embed HTML table built from it. The parser follows RFC 4180, so quoted fields, commas and line breaks inside quotes, and doubled escape quotes all land in the right cell. Every value is HTML-escaped, and you can toggle a header row, add a table class and switch between indented and minified markup.
How to convert CSV to an HTML table
- Paste or type your data into the CSV data box, or click Load sample to see the format.
- Leave First row is a header checked to render the top row as th cells, or uncheck it for an all-td table.
- Keep Pretty-print on for indented HTML, or turn it off for one minified line.
- Optionally type a name in the Table class field to add a class attribute to the table tag.
- Click Copy to grab the markup, or Download to save it as table.html.
Examples
Header row with body rows
Name,Role Ada,Engineer Linus,Maintainer
<table>
<thead>
<tr>
<th>Name</th>
<th>Role</th>
</tr>
</thead>
<tbody>
<tr>
<td>Ada</td>
<td>Engineer</td>
</tr>
<tr>
<td>Linus</td>
<td>Maintainer</td>
</tr>
</tbody>
</table>Comma inside a quoted field stays one cell
Fruit,Note Fig,"Sweet, dried"
<table>
<thead>
<tr>
<th>Fruit</th>
<th>Note</th>
</tr>
</thead>
<tbody>
<tr>
<td>Fig</td>
<td>Sweet, dried</td>
</tr>
</tbody>
</table>Minified output with Pretty-print off
a,b 1,2
<table><thead><tr><th>a</th><th>b</th></tr></thead><tbody><tr><td>1</td><td>2</td></tr></tbody></table>
Frequently asked questions
Does it handle commas inside quoted fields?
Yes. A field wrapped in double quotes can contain commas, line breaks and escaped quotes written as two double quotes, and the parser keeps it as one cell. In the Fig example above, the comma inside the quotes never splits Sweet, dried into two columns.
Is the generated HTML safe to paste anywhere?
Yes. Every cell is escaped, so <, >, &, double quotes and single quotes become <, >, &, " and '. That means data cannot break out of a cell or inject elements, and the table class you enter is escaped the same way.
What happens to a line break inside a cell?
A hard line break inside a quoted field is converted to a br tag, so a multiline cell still renders on separate lines in the rendered table instead of collapsing into one run of text.
What if my data has no header row?
Uncheck First row is a header. Every row is then rendered inside tbody as td cells with no thead section, which suits data that starts straight away with values.
Can I add a CSS class to the table?
Yes. Type a name into the Table class field and it is added to the opening tag as class="yourname", so you can target it from your own stylesheet. Leave it blank to get a plain table tag.
What does Pretty-print do to the output?
On, the markup is indented with two spaces and one tag per line, which is easy to read and diff. Off, the whole table is emitted as a single line with no whitespace between tags, which is smaller to ship.
How are ragged rows with different column counts handled?
Rows are padded to the width of the widest row, so short rows gain empty td cells and the table stays rectangular. No cell is dropped and no row is left with a missing column.
Can I get Markdown or JSON instead of HTML?
For a Markdown pipe table use the CSV to Markdown tool, and to turn the same data into structured records use CSV to JSON. This converter is focused on producing table markup for web pages and emails.
Is my data private?
Yes. Parsing and rendering run entirely in your browser, so the CSV you paste is never uploaded to a server.
Learn more
- Turning a CSV export into a web-ready HTML table
How CSV rows map to thead and tbody, why escaping matters, and how to style the result with a class instead of inline attributes.
Related tools
CSV to Markdown
Convert CSV data into a clean GitHub-flavored Markdown table. Handles quoted fields, commas, and pipes, with column alignment. Free, fast and private.
JSON to CSV
Convert JSON to CSV online. Paste an array of objects and get clean, spreadsheet-ready CSV with the right headers. Runs in your browser.
CSV to JSON
Convert CSV to JSON online. Turn spreadsheet rows into clean JSON objects or arrays, with smart number and boolean typing. Free tier plus API.
Air Fryer Converter
Convert any conventional oven recipe to air fryer settings. Lower the temperature by 25 F and cut the cook time by about 20 percent automatically.
Baker's Percentage Calculator
Turn a bread formula into grams with baker's percentages. Flour is 100 percent, enter water, salt and yeast percents to get weights and hydration.
Baking Pan Converter
Swap one baking pan for another and scale the batter to fit. Compares pan areas for round, square and rectangular pans and gives a batter scale factor.