araç köşesi

Convert CSV to an HTML Table

Turn CSV or cells copied from Excel into HTML table code for a web page, a blog post or an email

Your data stays with you. Conversion happens inside the browser; nothing is sent to a server.

How it works

Select your table in Excel and copy it (Ctrl+C, or Cmd+C on a Mac), or open a .csv file in Notepad or TextEdit and copy its contents, then paste into the left box; the HTML table code appears on the right at once. Cells copied from Excel or Google Sheets are separated by tabs, a CSV from US or UK Excel by commas, and one from a colleague in Germany or France often by semicolons; the tool detects the delimiter from the first lines and names it in the result line. The four-line product list in the example becomes three header cells inside a <thead> and three data rows inside a <tbody>. Values are copied as they are: a price of 1250.00 stays 1250.00 and a ZIP code such as 02134 keeps its leading zero. A <, > or & in a cell is written as &lt;, &gt; or &amp;, so a cell that says "<b>" does not turn the page bold and code pasted into a cell does not run. Short rows are padded with empty cells so the columns do not shift. Paste the code into a "Custom HTML" block in WordPress, the HTML view in Blogger, or the source view of an email template. For email, pick "Bordered and striped": the style is written into every cell, because email programs ignore separate style sheets.

This tool is also known as csv to html, csv to html table, convert csv to html table, excel to html table, html table generator.

What is HTML table?

An HTML table is the <table> element that draws rows and columns on a web page. Inside it, <thead> holds the header part, <tbody> the body, <tr> each row, <th> a header cell and <td> a data cell. The browser sizes the columns to their content; borders, padding and colors come from a separate style rule or from each cell's style attribute. Header cells also tell screen readers which column a value belongs to, so they matter for accessibility, not just for looks.

What is HTML escaping?

HTML escaping means writing characters that have a special meaning in HTML as entity names: &lt; for <, &gt; for >, &amp; for &, &quot; for a double quote. The browser shows the real character on screen but never reads it as a tag or as code. Outside data placed on a page without escaping can break the page's structure or open the door to cross-site scripting (XSS), which is why every value that goes into a table cell should be escaped first.

What is the difference between CSV and an HTML table?

CSV is only data: cells are split by a delimiter, there is no information about looks, and the file is meant to be opened in Excel or read by a program. An HTML table wraps the data in tags and is meant to be shown in a browser; it can say which row is the header and carry borders and colors. Paste a CSV straight into a web page and you get one run of plain text; an HTML table shows the columns lined up. Use CSV to move data into another program, and an HTML table to show it on a page or in an email.

Three traps: unescaped characters, style lost in email, shifted columns

Escaping: in HTML, < and > start and end a tag and & starts an entity. A cell reading "Price < 100 & in stock" placed on a page as it is looks like a broken tag to the browser, and part of the text disappears. Worse, a cell containing <script> could run code in your visitor's browser. This tool escapes every cell with the he library, including quotes and backticks; what the cell says is exactly what the page shows.

Email style: Gmail and Outlook often throw away the <style> block and external style sheets in an HTML email. If borders and padding are not written into each <td> and <th> as style="…", the table arrives cramped and without lines. "Bordered and striped" does exactly that and shades every other row lightly.

Shifted columns: when a row has fewer cells than the header, the browser does not draw the missing cells; the row moves left and values land under the wrong header. The tool pads short rows with empty cells and the result line says how many rows it padded.

  • "Price < 100 & in stock" → Price &lt; 100 &amp; in stock
  • "Plate, porcelain" (quoted) → one cell; the comma does not split the column
  • Short row → empty <td></td> added at the end

Which setting for which job

If your site or theme has its own table style, keep "Plain HTML"; the code stays clean and the theme draws the table in its own colors. WordPress, Blogger and most ready-made themes add borders and spacing to tables on their own.

If the table goes into a newsletter, a quote sent by email or anywhere that ignores style sheets, pick "Bordered and striped". If the first row is not a header, for example when you only move the body of a price list, pick "Data"; then no <thead> is written and every row is a normal cell. A table with a header row is easier to follow with a screen reader, so keep the default when you have headers.

Frequently asked questions

How do I turn an Excel table into HTML?

Select the table in Excel, copy it and paste it into the left box on this page; the HTML code appears on the right at once. Excel separates copied cells with tabs, and the tool recognises this by itself. Copy the code from the right box and paste it into your site's HTML editor.

Why does my HTML table show no borders in email?

Most email programs strip separate style blocks and keep only the style attribute written inside each tag. Set "Look" to "Bordered and striped"; border and padding are then written into every cell, and the table looks the same in Gmail, Outlook and phone mail apps.

What happens to a < or & sign in a cell?

These signs mean something in HTML, so they are written as &lt; and &amp;. The page still shows < and &, but the browser does not treat them as tags. Whatever a cell contains, the table stays intact and code typed into a cell does not run.

Is the data I paste sent to a server?

No. Parsing and building the HTML happen entirely in your browser; even a customer list or a price table you paste never leaves this page and is not stored.