CSV to HTML table converter

Paste CSV data and get clean <table> code for a web page, email template or blog post.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter csv data, cell delimiter, first row is the header, right-to-left table (dir="rtl") and trim spaces around each cell.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

With the header option on, the first row becomes <th> cells inside <thead> and the rest become <td> cells inside <tbody>. The characters & < > " become &amp; &lt; &gt; &quot; and line breaks become <br>.

Example

Inputs: Cell delimiter = Detect automatically, First row is the header = yes, Right-to-left table (dir="rtl") = no, Trim spaces around each cell = yes. Result: HTML code: <table> <thead> <tr><th>product</th><th>price</th><th>qty</th></tr> </thead> <tbody> <tr><td>Tea</td><td>12.5</td><td>3</td></tr> <tr><td>Coffee</td><td>18</td><td>2</td></tr> <tr><td>Dates</td><td>30</td><td>1</td></tr> </tbody> </table>; Rows: 4; Columns: 3.

product,price,qty
Tea,12.5,3
Coffee,18,2
Dates,30,1
<table>
  <thead>
    <tr><th>product</th><th>price</th><th>qty</th></tr>
  </thead>
  <tbody>
    <tr><td>Tea</td><td>12.5</td><td>3</td></tr>
    <tr><td>Coffee</td><td>18</td><td>2</td></tr>
    <tr><td>Dates</td><td>30</td><td>1</td></tr>
  </tbody>
</table>

Limits and caveats

  • No CSS is added, so the table takes the styling of your site or the browser.
  • Short rows are padded with empty cells, and merged cells (colspan) are not produced.

Questions about this tool

Is the code safe if my data contains tags?

Yes. <, > and & are escaped, so tags show as text and never run.

When should I turn on dir="rtl"?

When the data is Arabic, so the first column starts on the right and the table reads in the right order.

Can I paste the code into WordPress?

Yes. Paste it into a Custom HTML block and it shows as a normal table.