HTML Table Generator
Paste a grid of cells and get HTML table code with a live preview.
What this tool does
Paste rows copied from a spreadsheet, or type them with commas, pipes or semicolons, and the generator writes an HTML table with a thead for the header row and a tbody for the rest. Choose alignment and an optional simple border, check the live preview and copy the markup into your page.
Reads a pasted grid, detects the separator and writes semantic HTML table code.
Escapes special characters and shows a preview of the finished table.
How to use it
- Paste cells from a spreadsheet, or type rows.
- Leave the separator on automatic or choose one.
- Set the alignment, header row, border and indent options.
- Check the preview.
- Press Copy HTML or Download.
Why use this generator
Paste rows from Excel, Sheets or CSV and get clean HTML with thead, tbody, th and td - not just a pile of tags. Hand-writing tr, th and td tags is slow and easy to get wrong. Converting from a spreadsheet gives valid markup with a proper header section, ready to paste into a page, email template or CMS.
Why we built it
We built the HTML table generator to produce proper thead and tbody markup with escaped cells and a live preview. Make the Markdown version with the Markdown table generator and tidy the code with the HTML formatter.
Who this tool is for
- Web developers and bloggers adding tables
- Marketers building email templates
- Students learning HTML
When to use it
- Adding a data table to a web page or CMS.
- Building a table for an HTML email.
- Turning a spreadsheet into markup for documentation.
- Teaching or learning table structure.
How it works
The first row becomes a thead with th cells and the remaining rows go in a tbody of td cells. Characters &, < > and " are escaped so the content cannot be read as markup. The optional border adds inline CSS to each cell; for real sites you may prefer to style the table from your stylesheet.
What you give it, and what you get back
| Item | Details |
|---|---|
| Input | Rows of cells separated by tab, comma, pipe or semicolon. |
| Options | Separator, alignment, header row, border style and indentation. |
| Output | HTML table markup to copy or download as .html, with a preview. |
Issues you may run into
| What you see | Why it happens | What to do |
|---|---|---|
| Only one column appears | The wrong separator was detected. | Choose the separator manually. |
| Table looks plain on my site | No border style is applied or your CSS overrides it. | Tick the border option or style the table in your stylesheet. |
| Special characters look odd | They were escaped to keep the markup safe. | This is correct; the browser shows them normally. |
Assumptions and limitations
- Does not create merged cells (colspan, rowspan).
- Inline styles are simple; use your stylesheet for design.
Frequently asked questions
How do I convert an Excel table to HTML?
Copy the cells in Excel and paste them here. The tool writes a table with thead and tbody.
How do I add a border?
Tick the border option for inline styles, or style the table with CSS.
Can it make a header row?
Yes. The first row becomes th cells in a thead when the header option is on.
Are special characters escaped?
Yes. Ampersands, angle brackets and quotes are escaped so the markup stays valid.
Does it work with CSV?
Yes. Comma, semicolon, pipe and tab separators are supported.
Is my data uploaded?
No. Everything runs in your browser.