What CSV to HTML does
CSV to HTML reads CSV and writes it as an HTML table. The input is parsed first, so a syntax error is reported with its position instead of producing broken output.
CSV to HTML examples
The built-in sample
Input
id,name,city
1,Ada,London
2,Lin,BengaluruOutput
<table>
<thead>
<tr><th>id</th><th>name</th><th>city</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada</td><td>London</td></tr>
<tr><td>2</td><td>Lin</td><td>Bengaluru</td></tr>
</tbody>
</table>This is the input that the Load sample button fills in.
Cell values are escaped
Input
product,note
Pen,"<b>bold</b> & cheap"
Ink,Output
<table>
<thead>
<tr><th>product</th><th>note</th></tr>
</thead>
<tbody>
<tr><td>Pen</td><td><b>bold</b> & cheap</td></tr>
<tr><td>Ink</td><td></td></tr>
</tbody>
</table>The angle brackets and the ampersand in the first note are written as entities, so the cell shows the text instead of rendering markup. The empty field becomes an empty cell.
Each output was produced by running this tool on the input above it.
How it works
Reading CSV. The first row is the header. Fields can be quoted to contain commas, line breaks and doubled quotes (""), following RFC 4180. Every following row becomes an object; all values are strings, and a row with fewer fields than the header is padded with empty strings.
Writing an HTML table. The rows are written as an HTML table with a header row of column names. Every cell value is HTML-escaped, so the table is safe to paste into a page.
Details and limits
- Values are carried across without losing anything in ordinary data; the points above list the cases the two formats handle differently.
- The table has a
theadwith the header row and atbodywith the data, and no classes, styles or attributes, so it takes on the styling of the page you paste it into. - The output is a fragment: no
htmlorbodyelement is added. - Line breaks inside a quoted field are kept as line breaks in the cell text; HTML shows them as a space.
- Input that is not valid CSV stops the tool, and the status line shows where the problem is. The CSV to JSON page lists the usual causes.
Questions
Is my data uploaded when I use CSV to HTML?
No. The tool runs in your browser, so what you paste or open is processed on your own device and is not sent to a server.
What does CSV to HTML do?
CSV to HTML reads CSV and writes it as an HTML table. The input is parsed first, so a syntax error is reported with its position instead of producing broken output.
Are there any limits I should know about?
The table has a thead with the header row and a tbody with the data, and no classes, styles or attributes, so it takes on the styling of the page you paste it into. The output is a fragment: no html or body element is added.
Is there a size limit?
There is no fixed size limit. Everything happens on your device, so very large inputs depend on its memory and can take longer on a phone than on a computer.
Does it work on phones, and is it free?
Yes. It works in any current browser on Android phones, iPhones, tablets and computers. It is free and needs no account or sign-up.