CSV to HTML — Convert CSV Data to HTML Table Markup
Convert CSV data to formatted HTML table markup. Optional thead, tbody, and CSS classes, runs entirely in your browser. No uploads, no limits.
CSV to HTML Table
Convert CSV data to a formatted HTML table. Generates clean <table> markup with <thead> and <tbody>. Works entirely in your browser.
CSV to HTML is one of those conversions that looks like a job for a templating language and ends up needing a tool anyway. The reason is that a real CSV-to-HTML conversion has to handle three things that a naive string concatenation gets wrong: HTML escaping (so a <script> in a cell does not break the page), delimiter detection (so semicolon-separated European exports work without manual configuration), and header row interpretation (so the first row becomes <th> cells for accessibility and styling, not just another row of data). A 10-line script that wraps each cell in <td> works until the input contains a quote, a less-than sign, or a non-comma separator, and then the script becomes a bug report.
The non-obvious thing about generating HTML tables is accessibility. The default output here is semantic — <thead> and <tbody> separate the header row from the data, <th scope=\"col\"> marks each header cell as a column header, and the caption is rendered as a real <caption> element that screen readers announce. None of that is required for a table to render, but it is the difference between a table that works for everyone and a table that works for sighted users only. Screen readers use the <th> and scope attributes to announce the column name when reading each cell, which is what makes a data table navigable in a non-visual context.
For a final hand-off: if the HTML is going into a static site (a blog post, a documentation page, a GitHub README), copy the output directly. If it is going into a CMS that already has a table component, the Markdown variant is usually a better fit — most static site generators convert Markdown tables to HTML with proper <thead> automatically. If the destination is a web app that already loads a table library (DataTables, AG Grid), generate the unstyled HTML and pass it to the library; do not double-style.
How to use
Paste your CSV data
Drop the CSV into the input area, or load a .csv file. The tool auto-detects the delimiter (comma, semicolon, tab) and the presence of a UTF-8 BOM — both are common in real exports.
Pick the HTML structure
Choose between a minimal table (just `<table><tr><td>`), a semantic table (with `<thead>` and `<tbody>`), or a styled table (with Bootstrap-compatible classes). The preview updates as you switch.
Copy or download the HTML
Copy the HTML to your clipboard, or download it as a .html file. The output is a single self-contained table — no external CSS, no JavaScript, no image references. Paste it into any HTML document.
Frequently asked
Does the output include CSS styling?
By default no — the output is plain semantic HTML with no inline styles. Toggle the 'styled table' option to add Bootstrap-compatible classes (`<table class="table">`, `<thead class="table-light">`) for immediate use in a Bootstrap project.
Will the first row be treated as a header?
Are special characters escaped?
Yes — `<`, `>`, `&`, and quote characters in cell values are HTML-escaped. Pasting a CSV with `<script>` in a cell produces `<script>` in the output, which is safe to drop into any HTML page.
Can I add a caption or table ID?
Both are optional fields below the input. The caption renders as `<caption>` (semantic, good for accessibility), the ID renders as `<table id="...">` (useful for CSS targeting or JavaScript hooks).
How are empty cells rendered?
Empty cells render as `<td></td>` by default, which most browsers render with no visible content. Toggle the 'nbsp for empty cells' option to render `<td> </td>` instead, which preserves row height in tables with bordered cells.
Limitations
- No colspan or rowspanCSV is a flat grid — it cannot represent merged cells. If the source has merged headers, the output renders each cell separately and you will need to edit the HTML by hand to add `colspan` or `rowspan`.
- No nested tablesA cell value that contains a newline becomes a single line in the HTML, not a nested element. For complex cell content, post-process the output to split on newlines and wrap in `<br>` or `<p>`.
- Bootstrap classes onlyThe 'styled table' option emits Bootstrap 5 class names. For Tailwind, Material UI, or other frameworks, generate the unstyled table and apply your framework's classes in your own template.
Platform notes
- macOS
- Numbers and Excel both export UTF-8 CSVs by default on macOS. Older Excel for Mac may still emit MacRoman — re-save as UTF-8 if you see mojibake like é instead of é in the rendered HTML.
- Windows
- Excel for Windows defaults to ANSI or UTF-16 in some locales. Use 'CSV UTF-8 (Comma delimited)' from the export dropdown, never 'CSV (Comma delimited)', to avoid encoding issues in the output HTML.
- Linux
- Most Linux tools (cut, awk, miller) write UTF-8 by default. If you pipe from a Windows-originated file, run `iconv -f cp1252 -t utf8 input.csv > output.csv` first to keep the HTML output clean.
- Web
- Runs entirely client-side. Works offline once the page has loaded. The HTML output is portable — paste it into any HTML document, blog post, or static site generator without dependencies.