Excel to HTML Table turns a sheet from an .xlsx or .xlsm workbook, or a block of cells copied out of Excel, into a plain HTML <table> you can paste into a web page, a CMS or an email template. The usual job is small and annoying: a shipping-rate grid that has to go on a product page and into next week's customer newsletter. Excel can export HTML itself, but what it writes is a whole web page with a folder of support files, and you want twenty lines of table.
How to convert an Excel sheet to an HTML table
For a workbook, keep "Upload a workbook" selected:
- Drop an .xlsx or .xlsm file of up to 50MB on the box, or click to browse. The file is read in your browser and never uploaded, and your workbook isn't changed.
- If it has several sheets, keep "All sheets, one table each" or pick one sheet.
- Pick the styling: "Minimal inline CSS" (the default) or "No CSS". Check "The first row is the header"; it is ticked for you when the first row is all text.
- Look at the rendered table in the Preview, with the markup beside it (the first 60 lines). Then click "Copy HTML" for the table markup, or "Download .html" for a complete page. A file called sales.xlsx downloads as sales (xlsx.com).html.
For cells you already have open, switch to "Paste cells": select them in Excel, copy, paste into the box, set the same options, and copy or download. Paste mode is how you convert part of a sheet, because the upload always converts whole sheets.
What the Excel to HTML table output looks like
Here is a four-row rate card with the Region cell merged over two rows, a link on "Team", and a cell that reads R&D <beta>. With "No CSS" the tool writes:
<table>
<thead>
<tr>
<th>Region</th>
<th>Plan</th>
<th>Seats</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2">North</td>
<td>Starter</td>
<td>5</td>
<td>$1,234.50</td>
</tr>
<tr>
<td><a href="https://example.com/team">Team</a></td>
<td>25</td>
<td>$4,800.00</td>
</tr>
<tr>
<td>South</td>
<td>R&D <beta></td>
<td>10</td>
<td>$2,010.75</td>
</tr>
</tbody>
</table>
One cell per line, indented, so you can edit it by hand. The second North row has three cells: the merged Region cell above reaches down into its first column, so that cell is left out.
| In the sheet | In the HTML |
|---|
| First row, with the header box ticked | <th> cells inside <thead>; unticked, everything goes in <tbody> |
| Values with a number format | The text Excel shows: 02134, 12.5%, $1,234.50, dates in their date format |
| Formulas | Their last calculated result |
| Merged cells | One cell with colspan and rowspan; the covered cells are left out |
| A line break in a cell (Alt+Enter) | <br> |
&, <, > and " in cell text | &, <, > and ", so they show as text |
| A link to a web page, email address or file | <a href>, including any #part of the address |
| A link to a place in the workbook | Its text only; the page counts these |
| Empty rows and columns around the data | Dropped |
| Empty rows inside the data | Kept |
| Several sheets | One table per sheet, each under an <h2> with the sheet name, in sheet order |
Empty sheets are skipped. Hidden sheets are included and marked (hidden) in the sheet picker, so look before you paste every table onto a public page.
Inline CSS or no CSS
Choose "No CSS" when the table is going into a site that already styles tables. You get bare markup with no style attributes, and the site's stylesheet takes over.
Choose "Minimal inline CSS" when the table has to look like a table wherever it lands. That option writes border-collapse:collapse on the table, a 1px light grey border and 4px 8px of padding on every cell, a light grey background on the header, top alignment, and right alignment for any column whose values are all numbers. Dates count as numbers here, as they do in Excel.
The styles go in a style attribute on each element rather than one <style> block at the top, and that choice is deliberate. Many email clients and CMS editors strip <style> blocks from what you paste. A table from a generator that puts its CSS in a block looks fine in the generator's preview and can arrive in an email with no borders or padding, the cells running into each other. Inline attributes are verbose, but they survive.
On a narrow phone screen, a table with eight columns will run off the side of any page. That's a job for the page it sits in: wrap the table in <div style="overflow-x:auto"> and it scrolls sideways instead of squashing.
Merged cells, links and text that would break a page
Merged cells come through as they are in the sheet. A title merged across four columns becomes one cell with colspan="4", and the three cells beside it in that row are left out. The one exception is a merge that starts in the header row and runs down into the data. A cell can't sit in both <thead> and <tbody>, so the tool cuts it at the header and the data cells below come out as empty cells.
Cell text is escaped before it goes into the markup. A product note like Size <XL> or a supplier called Smith & Sons shows up as that text on the page and can't open a stray tag that swallows the rest of your layout.
Links get the same care. The tool reads them from the file itself, since the ExcelJS library it uses drops some. It writes a link only when the address is http, https, mailto, ftp or a relative path. A javascript: or data: link keeps its text and loses the link, even when someone has hidden tab or control characters inside the word to get it past a filter. That matters when the workbook came from outside your team.
Values follow the same rule as the site's Excel to CSV converter: what Excel displays, not what it stores. Other converters that read the stored value write 46085 for 4 Mar 2026, 2134 for a ZIP code formatted 00000, and 0.125 for 12.5%.
Making an HTML table in Excel without a converter
Excel for Windows has a built-in route: File > Save As, choose Web Page (*.htm; *.html) as the type, pick Selection: Sheet or Entire Workbook, then click Publish and choose the item to publish.
It keeps what this tool drops: Excel's fonts, fill colours, borders and column widths. It pays for that with markup. The page is full of mso- style rules and Microsoft-specific tags, and Excel writes a supporting folder named after the file (sales_files) that has to travel with the page. Fine for a standalone page. Hard work when you want the table inside an existing page: you dig the <table> out and strip the classes by hand.
For a table that updates with the sheet, a formula can write each row. With data in A2:D20, put this in F2 and fill it down:
="<tr><td>"&TEXTJOIN("</td><td>",FALSE,A2:D2)&"</td></tr>" // FALSE keeps empty cells, so columns don't shift
Copy F2:F20 and wrap the lines in <table> and </table> in your editor. The formula has three holes. It doesn't escape & or <, so a cell with either one can break the markup. It reads stored values, so dates come out as serial numbers. And it knows nothing about merged cells. For a one-off, pasting the cells into paste mode above is faster.
Limits
- Excel's formatting stays behind. Fonts, bold, fill colours, borders, column widths and the alignment you set in Excel aren't carried over. The only styling is the optional minimal inline CSS.
- Results, not formulas. A formula appears as its last calculated result. Notes and comments, images and charts are left out, and the page counts the notes and images before you copy.
- The header guess can pick a title. The first row with content becomes the header when it is all text. A sheet that opens with a title row like "Q3 rate card" gets that title as its header unless you untick the box.
- Whole sheets only when you upload. There's no range box. Copy the cells you want and use paste mode.
- Paste mode sees text only. The clipboard text carries no links and no merged cells. With inline CSS, a pasted column is right-aligned when every value in it reads as a number.
- No .xls files. Save the workbook as .xlsx in Excel first, or copy the cells and paste them. A file with a password to open is detected, and the page tells you why it can't be read.
- Big results skip the preview. Past about 1.5 million characters, the table isn't drawn in the preview. Copy or download it to see it.
Putting the same table in a README or a GitHub issue instead? Excel to Markdown writes it as a pipe table from the same displayed values, though Markdown has no way to span a merged cell.
Questions
How do I convert an Excel spreadsheet to an HTML table?
Upload the .xlsx here, or copy the cells in Excel and paste them into the box. You get a table with the header row in thead and the data in tbody, ready to copy into a page or download as a complete .html file.
Can Excel save a spreadsheet as HTML?
Yes, through File > Save As in Excel for Windows. Choose Web Page (*.htm; *.html), pick Entire Workbook or Selection: Sheet, and click Publish. The page keeps Excel's fonts and colours as mso- styles. It also depends on a supporting folder Excel writes beside it, which makes the table awkward to lift into another page.
How do I put an Excel table in an email without losing the formatting?
Excel's own fonts, colours and borders don't come across in this conversion. What you can keep is a readable table: use inline style attributes, because many email clients remove a style block and the borders and shading go with it. The Minimal inline CSS option adds plain borders, padding and header shading, all inline.
How do I add an Excel table to a WordPress page?
Paste the markup into a Custom HTML block, or the Text tab of the Classic Editor, since the visual editor tends to strip or rewrite pasted table code.
Does converting Excel to HTML keep merged cells?
This converter keeps them: a merged range becomes one cell with colspan and rowspan, and the cells it covers are left out. The exception is a merge that starts in the header row and runs into the data, which is cut at the header. Paste mode has no merged cells, since the clipboard text doesn't carry them.
Why do dates turn into five-digit numbers when I convert Excel to HTML?
Because Excel stores 4 Mar 2026 as the serial number 46085, and the converter wrote the stored value. This one applies each cell's number format first, so dates, currency signs and ZIP codes like 02134 come out as the sheet shows them.