Excel to HTML Table Converter

Put a sheet on a page without the markup Excel would give you. A real thead, a real tbody, escaped values, and not one conditional comment.

To convert Excel to an HTML table, drop your .xlsx above. The chosen sheet becomes a semantic table: header cells in a thead, data rows in a tbody, every value escaped, numeric columns right-aligned. Take a bare fragment for an existing page or a complete styled document. The workbook is read in your browser and never uploaded.

Want to filter the rows first? Open the app

What "Save as Web Page" actually produces

Excel can export HTML. What it produces is a document with a hundred lines of Office-specific CSS at the top, conditional comments for Internet Explorer, an XML island describing the workbook, empty spans around every value, and inline styles on every cell recording the font Excel happened to be using.

A ten-row sheet becomes forty kilobytes. Pasting it into a content management system usually fails, pasting it into an email breaks the email, and any developer who inherits it will delete the whole thing and start again.

What people want instead is the table. One element, real structure, no styling opinions they did not ask for. That is what this produces.

Worked example

Three rows of a product sheet:

Product ID   Product Name          Category      Unit Price   In Stock
SKU-101      Wireless Mouse        Audio         23.07        161
SKU-108      27in Monitor          Accessories   140.33       0

And the fragment:

<table>
  <thead>
    <tr><th>Product ID</th><th>Product Name</th><th>Category</th><th class="num">Unit Price</th><th class="num">In Stock</th></tr>
  </thead>
  <tbody>
    <tr><td>SKU-101</td><td>Wireless Mouse</td><td>Audio</td><td class="num">23.07</td><td class="num">161</td></tr>
    <tr><td>SKU-108</td><td>27in Monitor</td><td>Accessories</td><td class="num">140.33</td><td class="num">0</td></tr>
  </tbody>
</table>

Headers keep their spaces and their capitals, because an HTML header cell is a label for a person and there is no reason to mangle it. Only the two genuinely numeric columns carry the num class. The header row lives in a <thead>, which is what makes a screen reader announce the column name before each value.

What is deliberately dropped

Cell colours, fonts, borders, conditional formatting and column widths do not come through. That is a choice, not an omission.

A spreadsheet's formatting is a private language: a yellow cell means something to the team that made it and nothing to a reader on a web page. Carrying it over produces markup nobody can restyle, and the first thing a designer does is strip it. What survives the trip is the structure and the values, which is the part that is actually data.

One piece of formatting does get used, indirectly. A column formatted as a date reads as a date, so its values come through as ISO strings rather than as serial numbers, and a column formatted as text keeps its leading zeros.

Escaping, and the sheet contents that break pages

Spreadsheets are full of ampersands. Company names, product descriptions, department labels. An unescaped & in HTML starts an entity, and a browser will either render something unexpected or swallow the characters after it. Every one becomes &amp;.

Angle brackets show up too, in comparison text like < 30 days, and they will silently open a tag. The apostrophe is escaped as well, which most converters skip, because markup that is safe in a cell stops being safe the moment somebody pastes it inside a single-quoted attribute.

Excel cells commonly hold line breaks, typed with alt and enter. Those become <br>, so the cell renders as two lines instead of collapsing into one under HTML's whitespace rules.

Fragment, page, or nothing at all

  • Table only is a bare <table>: no doctype, no wrapper, no CSS. This is the one to paste into a page that already has styles.
  • Full HTML page adds a doctype, a character set, a title and a compact stylesheet with collapsed borders, a shaded header row and tabular figures on numeric columns. Save it and open it.
  • Styling off removes the CSS and the num class, giving markup with no classes at all, which is what a strict content management system usually insists on.
  • Caption adds a <caption> element, which a screen reader reads before the contents. Worth setting if the table is going on a public page.

Frequently Asked Questions

How is this different from Excel's own Save as Web Page?

Excel emits a document with Office-specific CSS, conditional comments, an XML island describing the workbook and inline styles on every cell. A ten-row sheet becomes forty kilobytes. This emits one table element with a thead, a tbody and nothing else.

Do cell colours and fonts come through?

No, deliberately. A spreadsheet's formatting means something to the team that made it and nothing to a reader on a page, and markup carrying it is the first thing a designer strips. Structure and values come through; presentation does not.

What about a cell with two lines in it?

It becomes a br. HTML collapses whitespace, so a raw newline would render as a single space and your two-line cell would silently become one line.

Are ampersands and angle brackets safe?

All five markup characters are escaped, apostrophe included. Spreadsheets are full of ampersands in company names and angle brackets in comparison text like < 30 days, and both break a page if they are written raw.

Why are only some columns right-aligned?

Because only some columns are numeric, decided from every value in the column. A product code that looks numeric but has a padded zero somewhere is text, and right-aligning it would present an identifier as a quantity.

Which sheet is used?

The first with data, and every sheet name is listed under the result so you can switch with one click. No modal blocks you before you have seen anything.

Put the sheet on a page, cleanly

One table element, semantic structure, everything escaped, no Office markup.

Back to the converter