CSV to HTML Table Converter

Paste CSV, choose a header row, and copy a table you can put on a web page.

Up to 100,000 characters, 1,000 rows, and 100 columns. Quoted fields may contain commas and line breaks. The preview and the HTML refresh on Generate, so edit then generate to publish a change.

Table preview

No preview yet.

HTML output

Why use our CSV to HTML Table Converter?

Escaped Before It Ships

Every cell and the caption are escaped, so a stray angle bracket or a pasted script tag shows up as text in the table instead of becoming markup.

Headers Marked Up Properly

With the header option on, the first row becomes th cells with scope="col" inside a thead, and the data rows go in a tbody.

Copy or Download

Copy the markup into your page or download it as table.html. Both stay disabled while the preview is out of date, so you never copy an old table.

What is a CSV to HTML Table Converter?

A CSV to HTML table converter turns comma-separated rows, such as a spreadsheet export, into table markup you can paste into a web page. This one parses the CSV, shows a preview, and writes one table element with an optional caption, header row and body.

The markup is a fragment, not a full document: no doctype, html, head, or body element. Drop it into an existing page; the Download button keeps the fragment as a file rather than a standalone page.

What the output contains

  • One table:One table element with no inline styles, so it inherits your page CSS.
  • Caption:A caption, only when you supply one. Keep it short instead of repeating the heading above it.
  • Header row:A thead with th scope="col" cells when the header option is on.
  • Body:A tbody for data rows. Quoted commas and line breaks stay inside their cell as text.
  • Size limits:Up to 100,000 characters, 1,000 rows, and 100 columns per table. Larger input gets an error and no table.

Common Use Cases

Spreadsheet Extracts

Export a range from a spreadsheet as CSV and publish it as a real table on a blog post or help page.

Documentation

Turn a list of options, prices or settings kept in CSV into a table for a docs page that already has its own styles.

Content Management Systems

Paste the fragment into an HTML block in a CMS that has no table editor, then style it with the site CSS.

Untrusted Data

Publish rows that came from a form or another person without hand-escaping them, since every cell is escaped as text.

Quick Prototypes

Drop realistic table markup into a page mockup to test column widths and the narrow-screen layout.

Accessible Reports

Give a data table a caption and marked-up column headers instead of an image of a spreadsheet.

How to turn CSV into a table

1

Paste the CSV

Paste comma-separated data into CSV input, or press Load example to see the format.

2

Set headers and caption

Decide whether the first record contains column headers and whether the table needs a caption.

3

Generate and inspect

Select Generate and inspect the preview for row and column shape. Fix CSV input if parsing reports an error.

4

Copy or download

Copy or download the HTML fragment, place it in your page, then check the rendered table at a narrow width.

Escaping and preview safety

Every Cell Escaped

Every cell and the caption are escaped for <, >, &, quotes, and apostrophes before they enter the markup, so a cell containing a script tag or an img element becomes visible text.

Preview Without Injection

The preview is rendered from the parsed values as text nodes, not by injecting the generated HTML, so pasted markup cannot execute on this page.

One Parse, One Result

The preview and the HTML come from the same Generate press. Edit the CSV, the header option or the caption and the page says the preview is out of date until you generate again.

Row rules and spreadsheet exports

  • •Same width: Every record must have as many columns as the first, which catches a missing or extra comma. A quote inside an unquoted field is rejected rather than silently swallowed.
  • •Blank lines: A blank line counts as one empty record, padded to the header width so the table stays rectangular. Empty input produces no table.
  • •Exported files: A byte order mark at the start of an exported file is stripped, and carriage return plus line feed counts as one line break.
  • •Semicolons: A spreadsheet set to a comma-decimal locale may export semicolons between columns. Those parse as one wide column here; replace the separator in your editor first.
  • •Unclosed quotes: A cell that unexpectedly spans several rows usually means a quote was opened and not closed. Paste the whole exported block rather than hand-editing it.
  • •Line breaks in cells: Wrap a value in double quotes to keep a comma or a line break inside it; the cell keeps both as text.

Publish Your CSV as a Table

Paste the rows, choose the header option, add a caption if the table needs one, and copy escaped markup that takes its look from your own stylesheet.

If you need JSON rather than a table, the CSV to JSON converter handles the same quoting rules. If your source is Markdown rather than CSV, use the Markdown to HTML tool instead.

Why the header cells carry scope

Column Headers

The generated header cells are th elements with scope="col", which tells a screen reader that the cell labels everything below it in the same column. Explicit scope helps disambiguate header associations, especially in more complex tables. Screen reader output was not tested on this page.

Row Headers

Row headers are the mirror case: scope="row" suits a table whose first column names the subject. This tool does not generate row headers.

Data in the First Line

If the first line of your CSV is data rather than column names, turn the header option off: rendering data as header cells mislabels every value for assistive technology, which is worse than an unstyled table.

Styling the output and a sticky header

table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid #d4d4d8; padding: 0.5rem 0.75rem; text-align: left; }
thead th { background: #f4f4f5; position: sticky; top: 0; }

The Basic Rules

A few rules cover most cases: collapse the borders, add cell padding, and give the header row a background so it separates from the body.

A Sticky Header

A sticky header needs a scrolling ancestor: wrap the table in a container with a maximum height and overflow-y: auto, otherwise the header sticks to the page.

Long Values

Long unbroken values such as URLs still widen a column, so on narrow screens wrap the table in a horizontal scroller or set overflow-wrap: anywhere on the cells.

Very Wide Tables

For a very wide table, hiding columns on small screens with a media query keeps the first two columns visible. Keep the header and the cells in step, since a column removed from the head but left in the body shifts every value one place to the left.

Related tools