How to use the html table generator
- Paste your rows into the table data box, one row per line, with cells separated by commas or tabs. You can paste straight from a spreadsheet.
- Choose whether the first row is a header and whether the first column is a row header, and add a caption if you want one.
- Pick the styling: plain HTML, simple borders with inline styles, or a class name for your own CSS.
- Check the preview, then press Copy HTML and paste it into your page.
Formula
Header row cells use th with scope="col" inside a thead
Row header cells use th with scope="row"
Other cells use td inside a tbody
Cell text and the caption are escaped: & < > and " become & < > and "
The table markup follows standard HTML. The preview is built from your cells, not from the generated code, so it cannot run anything you type.
Worked example
Pasting Name,Role,Score, then Ava,Lead,92, Ben,Design,88 and Cam,Support,79 with a header row produces a table with a thead holding three th cells and a tbody with three rows of td cells.
A cell containing a & b becomes a & b, and a cell containing a tag such as a script element is shown as text, because the angle brackets are escaped.
Accessible tables
Header cells with a scope attribute tell screen readers which cells they describe, and a caption gives the table a name. Turn on the row header option when the first column labels each row. Keep tables for data, not for page layout.
Styling choices
The plain option gives bare markup you can style anywhere. The simple borders option adds inline styles so the table looks right in an email or a page with no stylesheet. The class option adds a class name you can target in your own CSS. For other formats see the Markdown table generator, and for page layout the flexbox generator.
Limits and privacy
The tool accepts up to 200 rows and 30 columns. Quoted fields can contain commas, and a short row is padded with empty cells. Everything runs in your browser and your data is not uploaded. To read or check structured data, try the JSON viewer or the case converter.
Assumptions and limits
- Input is comma or tab separated text. Other separators, such as semicolons, are treated as part of the cell text.
- Every cell is plain text. Links, images and merged cells are not generated.
- Class names may use letters, digits, hyphens and underscores, and must not start with a digit.
- The inline style option uses fixed example borders and padding that you can edit after copying.
Frequently asked questions
How do I convert a spreadsheet to an HTML table?
Copy the cells in your spreadsheet, paste them into the data box and the tool builds the table code. Tabs from the spreadsheet are recognized as separators.
How do I make the first row a header?
Leave the first row is the header option ticked. The first row is placed in a thead with th cells.
Is the generated HTML safe to paste into a page?
Cell text and the caption are escaped, so special characters show as text and cannot add tags. Review the code anyway before you publish it.
Can I add borders without a stylesheet?
Yes. Choose the simple borders option and the tool adds inline styles for borders and padding to the table and its cells.