CSV to HTML Table

Turn pasted CSV into an indented HTML table with semantic head and body sections, escaped cells, an optional caption and a class hook for styling.

csv-to-html-table · runs locally

Clean, safe HTML tables from any CSV

Hand-converting CSV to HTML is tedious and, worse, dangerous when done naively: a cell containing <, & or a pasted <script> tag will break your markup — or execute — the moment it lands in a page. This converter HTML-escapes every cell (&, <, >, "), so the output is safe to drop into any document regardless of what the spreadsheet contained.

With the header checkbox on, the first row becomes <th> cells inside a semantic <thead>, with data rows in <tbody> — better for screen readers, sticky headers and print. The output is consistently indented, and the delimiter (comma, semicolon, tab, pipe) is detected automatically with a manual override. Ragged rows are padded with empty cells so every row has the same column count.

Styling the output

Set a class name in the options and hang your CSS off it. A minimal starting point:

.data-table { border-collapse: collapse; width: 100%; }
.data-table th, .data-table td { border: 1px solid #d7dce1; padding: 8px 10px; text-align: left; }
.data-table th { background: #f4f6f8; }

The optional <caption> renders above the table and doubles as its accessible name.

When Markdown is the better target

If the table is headed for a README, pull request or wiki, raw HTML is usually the wrong format — the CSV to Markdown Table converter produces GFM pipe tables instead. And if you only need to escape a snippet of text rather than build a table, the HTML Entity Encoder does exactly that.

Frequently asked questions

Is my CSV uploaded to a server?

No. The CSV is parsed and the HTML generated in your browser — the data is not intentionally sent to an application server by Utilshut. CSV exports frequently contain customer records or production data, so the tool is built to keep everything on your machine.

Why does the converter escape < and & in my cells?

Because unescaped CSV pasted into HTML is a real hazard: a cell containing <script> or a stray < breaks the page or opens an XSS hole if the data came from users. This tool escapes &, <, > and " in every cell, so any CSV converts to markup that renders as literal text.

What do <thead> and <tbody> actually buy me?

Semantics with practical payoffs: screen readers announce header cells for each data cell, position: sticky on thead keeps headers visible while scrolling, browsers repeat the header on every printed page, and search engines understand the table structure better than a pile of bare <tr> rows.

How do I style the generated table?

Fill in the class name field — it is added to the <table> tag as a styling hook. Then target it in CSS, e.g. .data-table td { padding: 8px; border: 1px solid #ddd; }. The starter snippet in the guide below gives you clean borders and header shading in six lines.