Format Code Now
/
Web & markupTable to HTML Converter Next: Text to HTML Converter ›

Table to HTML Converter

WM-69

Copy cells from a spreadsheet or paste CSV and get a clean HTML table. You can also type a size like 4x3 for an empty grid to fill in.

Runs in your browser. Nothing is uploaded.

Table cells (tab, comma, semicolon or pipe separated). Use the Empty grid action with a size such as 4x3

HTML

How to use it

  1. Copy the cells in Excel or Google Sheets and paste them into the input box, or paste CSV text.
  2. Choose Table from data. Leave the delimiter on Auto, or pick one.
  3. Set the header option, an optional class name and the indent. Add -- caption: Title as a first line for a caption.
  4. Copy the HTML, or switch to Empty grid and type a size such as 4x3.

Table from data

Rows pasted from a spreadsheet are tab separated, and the delimiter is detected from the first line. You can also paste CSV, semicolon or pipe separated text. The output is a plain table with thead and tbody, header cells as th with scope="col", and every cell HTML-escaped. A line break inside a quoted cell becomes a br tag. Short rows are padded with empty cells, and turning the header option off writes every row as a body row.

Captions and classes

Start the input with a line such as -- caption: Stock levels to add a caption element. The class list only adds a class name, such as table or table table-striped, to the table tag so your own stylesheet or framework can pick it up. No CSS is included in the output. The result is a table fragment, not a whole page, so paste it where you need it.

Empty grid

Type a size as rows x columns, such as 4x3, and choose Empty grid. You get a header row with Column 1, Column 2 and so on, then empty cells for the rest. The row count includes the header row, so 4x3 gives one header row and three body rows. The size is limited to 200 rows and 50 columns.

Error messages and what to do

MessageWhat it meansFix
Type the size as rows x columns, for example 4x3 (up to 200 rows and 50 columns).Empty grid needs a size and the input is something else.Replace the input with a size such as 4x3.
The size is limited to 200 rows and 50 columns.The rows or columns number is above the limit.Use a smaller size.
No rows found in the CSV.Table from data got empty input.Paste some cells or CSV.

Questions people ask

How do I turn an Excel table into HTML?

Select the cells in Excel, copy them, and paste into the input box. They arrive tab separated and the HTML table appears at once. Copy the HTML into your page.

How do I make an empty HTML table?

Choose Empty grid and type the size, for example 5x4. You get a table with a header row and empty cells. The rows count includes the header, so 5x4 has four body rows.

Can I add a caption or a class?

Yes. Put -- caption: Your title on the first line of the input for a caption, and pick a class from the list. The class only sets the class attribute on the table tag.

Is the cell text escaped?

Yes. Characters such as & < and > in your data are escaped, so they show as typed and cannot break the page markup. You can try it with the sample first to see the output.

Does the output include styling?

No. It is a plain table fragment. Add your own CSS, or use the class option to hook into a framework you already use. Copy the result or download it with the buttons above the output.

About this tool

Table from data takes rows you paste from a spreadsheet (tab separated) or a CSV and writes a plain <table> with <thead> and <tbody>. Header cells are <th scope="col">, every cell is HTML-escaped, and a line break inside a quoted cell becomes <br>. Start the input with a line such as -- caption: Stock levels to add a <caption>. The class option only adds a class name to the table tag; no stylesheet is included. Short rows are padded with empty cells, and turning the header option off writes every row as a body row. Empty grid reads a size such as 4x3 (rows by columns, up to 200 by 50) and writes a table whose header cells read Column 1, Column 2 and so on with empty body cells; the row count includes the header row. The result is a table fragment, not a whole page.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.