CSV to HTML Table
Convert csv to html table using the available input and format options.
About CSV to HTML Table
Price lists, timetables and survey summaries are often exported from spreadsheets or databases as CSV. Publishing them on a web page means turning each row into table markup. Doing that by hand for more than a few rows is slow and easy to break, especially when cells contain commas or quotes.
How it works
Each non-empty line is one row. A line containing a tab is split on tabs; otherwise it is split on commas. Values wrapped in double quotes may contain the delimiter, and a doubled quote inside them becomes a single quote. Cells are trimmed and HTML-escaped. The first row becomes header cells inside <thead>; the rest become data rows inside <tbody>. Semicolon-separated files are not supported, and quoted values cannot span multiple lines. The table has no styling or attributes. The output downloads as table.html.
How to use CSV to HTML Table
- Enter the text or data in the format shown in the text box above (Paste comma-separated rows).
- Select “Create HTML table” and check the result before copying or downloading it.
Worked example
Paste three lines: 'Name,City,Score', '"Lee, Ana",Austin,91' and 'Raj,"New ""North"" Bay",88'. You get a table with headers Name, City and Score, a row Lee, Ana | Austin | 91, and a row Raj | New "North" Bay | 88, where the quotes in the city name are written as " entities.
Tips for a better result
- Open semicolon-delimited files, common in European locales, in a spreadsheet and re-export with commas, or copy the cells directly to paste tab-separated data.
- Make sure the first line is a header row, since it is always turned into <th> cells.
- Add a class to the table tag after pasting so it picks up your site's table styles.
Frequently asked questions
What if a cell contains a line break?
Quoted values spanning several lines are not supported, because each line is parsed separately. Replace line breaks inside cells before exporting, or the row will be split.
Do rows need the same number of columns?
No check is made. A row with fewer or more cells than the header produces a ragged table. Fix missing values in the source for a tidy result.
Is the CSV uploaded anywhere?
No. You paste the data into the page and the table markup is built in your browser. There is no file upload option.
What to check
Test generated markup in your own page. Sanitize untrusted content before inserting it into a live website.
Read the Privacy Policy for information about local processing, connected services and advertising.