Developer tool

Create HTML Tables from TSV

Paste rows separated by tabs and lines, choose whether the first row is a heading, then copy the table markup.

Runs in your browser. No upload.

Preview

About this tool

Create HTML Tables from TSV made simple.

Cell content is escaped as text, not executed as HTML. The preview is local. Use a screen-reader-friendly table caption and headings where they help explain the data.

Guide

Using Create HTML Tables from TSV

The HTML Table Generator turns rows of tab-separated text into the code for a table. You paste lines from a spreadsheet or type them with tab characters, choose whether the first line is a heading row, add an optional caption, and copy the markup. A preview shows the table. The code has no styling, and the tool does not read CSV files or comma-separated text.

How to use it

  1. Paste your rows into the box. Each line becomes one table row, and each tab character starts a new cell. Copying a block of cells from a spreadsheet usually gives you tab-separated text.
  2. Tick or untick First row contains headings. When it is ticked, the first line becomes the header cells and the rest become the body.
  3. Type a caption if you want one. It is optional and can be up to 160 characters.
  4. Press Generate table, check the preview, and press Copy code to take the markup. Reset clears the boxes.

Worked examples

A small table with headings and a caption

You enter
Rows
Name City Ana Madrid Luis Leon
First row is heading
yes
Caption
Clients
You get
Code
<table> <caption>Clients</caption> <thead> <tr><th scope="col">Name</th><th scope="col">City</th></tr> </thead> <tbody> <tr><td>Ana</td><td>Madrid</td></tr> <tr><td>Luis</td><td>Leon</td></tr> </tbody> </table>

The first line becomes header cells marked as column headers, and the other lines become body rows. The caption comes first inside the table.

Run through the tool’s own code.

Special characters in cells

You enter
Rows
A<b> 5 & 6 "x" 'y'
First row is heading
no
You get
Code
<table> <tbody> <tr><td>A&lt;b&gt;</td><td>5 &amp; 6</td></tr> <tr><td>&quot;x&quot;</td><td>&#39;y&#39;</td></tr> </tbody> </table>

Characters such as angle brackets, ampersands and quotes are replaced by safe codes, so the text shows on the page as typed and is not read as HTML. With the heading box unticked, every line is a body row.

Run through the tool’s own code.

A heading row and nothing else

You enter
Rows
Name City
First row is heading
yes
You get
Message
Add at least one data row after the heading row.

When the first row is a heading, at least one more row must follow it. Either add a data row or untick the heading box.

Run through the tool’s own code.

Rows with different numbers of cells

You enter
Rows
a b c
First row is heading
yes
You get
Message
Use the same 1–20 tab-separated columns in every row.

The first row has two cells and the second has one. Every row must have the same count, so the tool stops with this message.

Run through the tool’s own code.

When it helps

  • Move a block of spreadsheet cells into a web page or a blog post.
  • Build the table for an HTML email or a help article without writing tags by hand.
  • Teach students what the table, header and cell tags look like by comparing the text with the code.
  • Make a quick, plain table to restyle later with your own stylesheet.

Limits to keep in mind

  • The input can have up to 20,000 characters, 100 rows and 20 columns. Every row must have the same number of cells, and each cell can hold up to 2,000 characters.
  • Cells are split only on tabs. Commas, semicolons and quote marks are not read as separators, and a cell with a line break inside it will break into two rows.
  • The output is a bare table with no classes, colours, borders or merged cells. You need your own CSS, and rowspan or colspan must be added by hand.
  • Blank lines are dropped, but a line that holds only spaces still counts as a row, so its row length must match.

Tips

  • Keep the heading box ticked when the first line holds column names. Marked header cells help people who use screen readers.
  • Add a short caption that says what the table shows. It gives context before someone reads the cells.
  • If your data is comma-separated, replace the commas with tabs in a text editor before you paste it.

Sources

Common questions

About Create HTML Tables from TSV.

How do I get tab-separated text?

Copy a block of cells in a spreadsheet and paste it into the box. Most spreadsheet programs place tabs between columns and line breaks between rows on the clipboard. You can also type the text yourself by pressing the Tab key in a plain text editor and pasting it here.

Can I paste comma-separated (CSV) data?

Not as it is. The tool splits cells only on tab characters, so a comma-separated line becomes a single cell. Change the commas to tabs first, and take care with values that have commas inside them.

Why does it say every row needs the same columns?

A table with uneven rows would leave gaps or misalign cells, so the tool checks the count of the first row against the rest. If a row is shorter, add empty cells by putting extra tabs, and recheck that no stray tab sits at the end.

Is the cell text safe from being read as code?

The tool replaces ampersands, angle brackets and quote marks with their safe text forms, so a cell holding something like a tag shows as plain text in the table. It does not remove or fix any other part of your page, so review the result before publishing.

What are the table and header tags for?

A header cell marked with scope set to column tells assistive technology that it names the cells below it. A caption gives the table a title. Mozilla's page on the table element and the W3C table tutorial, listed below, explain both ideas.

What are the size limits?

You can paste up to 20,000 characters, 100 rows and 20 columns, with each cell holding up to 2,000 characters and the caption up to 160. Anything above these limits shows a message instead of code.

Is my pasted data uploaded?

No. The tool runs in your browser, the page says nothing is uploaded, and the preview is built locally. The result is not stored, so copy the code before you leave the page.

How do I use HTML table generator?

Paste rows separated by tabs and lines, choose whether the first row is a heading, then copy the table markup.

Is my data uploaded to a server?

No. This tool runs locally in your browser. Your input is not uploaded.