# Excel Save As Web Page: Why the HTML Is a Mess

> Excel's own HTML export carries Office namespaces, mso styles and a folder of supporting files. Here is what is inside the file, why it breaks your page, and four ways to get a clean HTML table instead.

Source: https://llamapress.ai/why-excel-save-as-web-page-produces-messy-html-and-how-to-clean-it-up | Updated: 2026-09-04

---

[LlamaPress Blog](https://llamapress.ai/blog)

Excel's own HTML export carries Office namespaces, mso styles and a folder of supporting files. Here is what is inside the file, why it breaks your page, and four ways to get a clean HTML table instead.

 [Back to all articles](https://llamapress.ai/blog)

![Kody Kendall](https://llamapress-ai-image-uploads.s3.us-west-2.amazonaws.com/jujc1ep8nuqrdiftdfer1ngp833u)

Written by

### Kody Kendall

AI & Software Engineer | Creator of the Leonardo Coding Agent

Updated September 2026

Excel's Save As Web Page works, and the file it writes is very large. A three column table can come out as thousands of lines, because Excel writes its own formatting model into the page along with the data. You get Office XML namespaces, a block of mso prefixed CSS, numbered style classes on every cell, and a separate folder of supporting files. If you paste that into a CMS, it will fight your stylesheet and usually lose. The fix is to export the values and write the table markup yourself, which takes about ten seconds with a converter.

In short

- Excel's Web Page export is built to round trip back into Excel, so it stores Excel's model, not clean web markup.
- Microsoft says the export keeps "fewer Excel features" than the original, and recommends keeping the .xlsx as your master copy.
- The Web Page option also writes a folder of supporting files. Single File Web Page (.mht) embeds them, and most CMS platforms will not accept a .mht at all.
- For pasting into a page, generate the table from the values instead. That is what our free converter does.

I write software that reads spreadsheets for a living, so I have opened a lot of these files. The mess is not a bug. Excel's HTML export was designed so the file could be reopened in Excel with the formatting intact. Keeping the formatting means storing Excel's own model in the page, and Excel's model does not look like web markup.

## What is actually inside the file

Open an Excel HTML export in a text editor and you will usually find five things that have nothing to do with your data.

**Office XML namespaces.** The html tag carries extra namespace declarations for Office and Excel. Browsers ignore them. Validators and some editors do not.

**A large mso style block.** Excel writes hundreds of rules using Microsoft specific properties that begin with mso. They control print behaviour and Excel rendering. In a browser they do nothing except make the file bigger.

**Numbered style classes on every cell.** Instead of semantic classes you get generated names such as xl65 and xl66, one per unique cell format. A sheet with a lot of formatting can produce a hundred of them. None of them mean anything to a person reading your code later.

**Cell type attributes.** Cells often carry Excel specific attributes that record whether the value was a number, a string or a date. These exist so Excel can read the file back correctly.

**Conditional comments and layout tables.** Older exports wrap the content in extra tables and comments aimed at old versions of Internet Explorer.

On top of that, choosing **Web Page (.htm, .html)** makes Excel "create supporting files and folders", as Microsoft's [static web page documentation](https://support.microsoft.com/en-us/office/save-all-or-part-of-a-workbook-to-a-static-web-page-5ad26dee-8739-4d80-b9d9-cf0530ab1968) puts it. Upload the .htm without that folder and the page loses its images and styling. The **Single File Web Page (.mht)** option bundles everything into one file, which solves the folder problem and creates a new one, because most content management systems will not host a .mht.

## Why it breaks your page

Three failures come up over and over.

The style block collides with your site. Excel's CSS is not scoped to the table. It sets rules on general elements, so pasting the whole export into a page can restyle text that has nothing to do with the spreadsheet. Font sizes shift. Borders appear where you did not want them.

The CMS strips half of it. WordPress, Ghost, HubSpot and most email tools sanitise pasted HTML. They usually keep the table and drop the style block, so you end up with the ugliest possible result. All the structure, none of the formatting it depended on.

The page gets heavy. A file that should be 4 KB of table arrives at several hundred kilobytes. On a marketing page that is a real speed cost, and speed is a ranking factor.

## What clean table markup looks like

A table for the web needs four things and nothing else. One table element. A thead holding the header row in th cells. A tbody holding the data rows in td cells. Your own stylesheet doing the styling.

Clean output

```
<table>
  <thead>
    <tr><th>SKU</th><th>Description</th><th>Unit price</th></tr>
  </thead>
  <tbody>
    <tr><td>RM-220</td><td>Ratchet strap 5m</td><td>14.90</td></tr>
    <tr><td>RM-240</td><td>Ratchet strap 9m</td><td>19.50</td></tr>
  </tbody>
</table>
```

That is readable by a screen reader, indexable by a search engine, and stylable by you. It is also short enough to review by eye before you publish it, which matters when the table holds prices.

## Four ways to get clean HTML from Excel

### 1. Use a converter that writes the markup for you

This is the fastest and it is what I would do. Our free [Excel to HTML converter](https://llamapress.ai/excel-to-html) reads .xlsx, .xls, .xlsm and .csv files, gives you a plain table, and lets you decide whether to include a small stylesheet. The file is parsed in your own browser, so nothing is uploaded. Copy the result or download it as an .html file.

### 2. Export a clean CSV first

Save the sheet as .csv, which throws away all formatting by design, then convert the CSV. You lose merged cells and colours, which is usually the point.

### 3. Paste through a plain text step

Copy the range, paste it into a plain text editor to strip the formatting, then rebuild the table. This works for a ten row table and stops being sensible above about fifty rows.

### 4. Clean the Excel export by hand

If you have to start from Excel's file, the order that works is: delete everything outside the table element, delete the entire style block, delete every class attribute, delete the Excel specific attributes on cells, then wrap the first row in thead and th tags. Check the result in a browser before you publish. Expect fifteen minutes for a table of any size, every time the data changes.

## The one good reason to use Excel's export

AutoRepublish. In the Publish as Web Page dialog you can tick **AutoRepublish every time this workbook is saved**, so saving the workbook rewrites the page. If the file sits on a server that serves that folder directly, and the ugly markup does not matter because the page is standalone, that is a genuinely useful automation for an internal report.

It stops making sense the moment the table has to live inside a designed page. Then you are pasting Excel's model into somebody else's stylesheet, and the two will not agree. It also stops making sense when visitors need to search the data rather than scroll it, which is the point at which people [convert the spreadsheet into a website](https://llamapress.ai/excel-to-website) instead.

## What about converting an Excel sheet into a web form?

A form is a different output entirely. HTML export gives you a read only table. A form needs inputs, validation and somewhere for the answers to go. That is covered in [converting an Excel spreadsheet into a web form](https://llamapress.ai/convert-your-excel-spreadsheet-into-a-web-form-your-team-actually-fills-in), and if the answers have to be stored and reported on, you are describing an application rather than a page.

## Frequently asked questions

### How do I convert Excel to HTML without the extra code?

Use a converter that builds the table from cell values instead of from Excel's formatting. Ours is at [llamapress.ai/excel-to-html](https://llamapress.ai/excel-to-html) and outputs a table element with no Office markup in it.

### Why is my exported HTML file so large?

Because it stores Excel's formatting model so the file can be reopened in Excel. The data is a small part of it. Microsoft also notes that even with all of that, the export keeps "fewer Excel features" than the original workbook.

### What is the difference between .htm and .mht?

Web Page (.htm, .html) writes the page plus a folder of supporting files. Single File Web Page (.mht) packs everything into one file. Browsers can open both. Most content management systems accept neither as a page you can paste into.

### Does the export keep my formulas?

No. HTML has no calculation engine, so you get the last calculated values. If the formulas need to keep running, you need software rather than a page. See [whether you can keep your Excel formulas and VBA macros](https://llamapress.ai/can-you-keep-your-excel-formulas-and-vba-macros-when-you-convert-to-a-web-app).

### Can I convert an .xls file, not just .xlsx?

Yes. The [converter](https://llamapress.ai/excel-to-html) reads the old Excel 97 to 2003 .xls format directly, so you do not need Excel installed to convert an XLS to an HTML table.

### Skip the cleanup

Drop the workbook into our free converter and get a clean HTML table you can paste anywhere. No signup, no upload, no mso styles.

[Convert Excel to HTML, free](https://llamapress.ai/excel-to-html) [Or build a live website from it](https://llamapress.ai/excel-to-website)

Need the whole workbook rebuilt as software your team signs into? See the [Excel to app converter](https://llamapress.ai/excel-to-app) or [contact us](https://llamapress.ai/contact).

Sources: Microsoft, [Save all or part of a workbook to a static Web page](https://support.microsoft.com/en-us/office/save-all-or-part-of-a-workbook-to-a-static-web-page-5ad26dee-8739-4d80-b9d9-cf0530ab1968); Microsoft, [Save a workbook as a webpage](https://support.microsoft.com/en-us/excel/save-a-workbook-as-a-webpage). Both checked September 2026. Descriptions of the export's markup are typical of Excel for Windows and vary by version.
