How to use
- In Excel or Google Sheets, select the cells, copy them (Ctrl+C) and paste them (Ctrl+V) into the input box.
- Check the table in the preview and pick your options: whether the first row is a header, whether numeric columns are right-aligned, and which style to add.
- Copy the HTML code into your blog, forum, email or web page, or save it with Download .html.
CSV text also works in the same box. The delimiter defaults to auto-detect: if there is a tab it uses tab (Excel copy), otherwise whichever of comma and semicolon appears more.
Options
| Option | What it does |
|---|---|
| First row is the header | Makes the first row <th> cells in <thead> and the rest <td> cells in <tbody> |
| scope attribute on th | Writes <th scope="col"> so screen readers know it is a column header |
| Trim spaces around cells | Removes leading and trailing spaces from each value |
| Line breaks as br | Turns line breaks inside an Excel cell (Alt+Enter) into <br>. When off they become one space |
| Put nbsp in empty cells | Fills empty cells with so some editors do not collapse them |
| Right-align numeric columns | Right-aligns a column when every value below the header is a number |
| Style: None | Plain table code with no decoration |
| Style: Inline style | Adds style to each tag so borders show without CSS. For email and forums |
| Style: style block | Puts a <style> block before the table and styles it through a class (default excel-table) with borders and zebra rows |
| caption, class, id | Set the table title and attributes |
Sample result
Converting the sample in the box (4 rows, 4 columns, columns 2 and 3 numeric) gives:
- The first row
Branch,Jan sales,Feb sales,Notebecomes<th scope="col">cells in<thead>. - The two columns that hold only values like
1,200,000and850,000are treated as numeric and getstyle="text-align: right;". The header cells follow the same alignment. New <opening>becomesNew <opening>and is shown as text.- The cell with a line break,
Promotionand(3 days), becomesPromotion<br>(3 days). - Daegu’s empty February cell stays as
<td style="text-align: right;"></td>.
Escaping and safety
Every <, >, &, " and ' in a cell becomes <, >, &, " or '. A cell containing something like <script> therefore comes out as text, not code. For class and id only letters, digits, - and _ are kept.
How numbers are recognised
1,234, -5.2, 12%, $3,000 and .5 count as numbers. Values with a leading zero such as 007 (codes, postal codes), dates (2024-01-01) and malformed thousands like 1,23 do not, so they are not aligned. If any value in a column is not a number, that column is left alone.
The format of Excel’s clipboard text
Excel puts copied cells on the clipboard as text split by tabs and line breaks. A cell that contains a line break, tab or double quote is wrapped in double quotes with inner quotes doubled. This tool reads that exact rule, so multi-line cells land in one cell. In merged cells only the first cell has a value and the others are empty; rowspan and colspan are not generated.
Frequently asked questions
How do I put an Excel table in a blog post?
If your blog supports HTML, choose Inline style and paste the code in HTML mode. If your blog theme already styles tables, None fits better.
Is there a size limit?
Up to 5,000 rows and 200 columns are converted, and the preview shows the first 50 rows. The input can be up to 2MB.
Can I go the other way, from an HTML table to Excel?
The HTML Table to CSV tool handles that direction.
Can I get a Markdown table instead?
Use the Markdown Table Generator.
Related tools: HTML Table to CSV, CSV Excel Converter, Markdown Table Generator, HTML Entity Converter, HTML Beautify and Minify.
The pasted table is processed in your browser and never sent to a server.