How to Convert an Excel Sheet to an HTML Table

Turn an Excel sheet into clean HTML or a Markdown table you can paste into a web page, README or wiki, without the bloated markup Excel pastes in.

Updated 5 min read By CodingEagles
Free tool Excel to HTML & Markdown Table Turn a sheet into a clean HTML or Markdown table. Open tool

You want a table from your spreadsheet on a web page, in a README, or in a wiki. Copying straight out of Excel pastes a wall of inline styles that bloats your page and is miserable to clean up. This guide shows how to get a clean table instead, in semantic HTML or Markdown, that drops in neatly.

The short version: open the workbook, pick HTML or Markdown, and copy the result. The Excel to HTML and Markdown table converter does it on your device.

Why a direct copy-paste goes wrong

When you select cells in Excel and paste them into a visual web editor, Excel hands over far more than the data. It includes inline style attributes for every cell, mso- Microsoft Office properties, fixed pixel widths and font declarations. The result looks roughly right at first, then causes problems: the markup is enormous, it ignores your site’s design, and it is hard to restyle because every cell carries its own hardcoded look.

A clean conversion strips all of that away. You get a table built from nothing but <table>, <tr>, <th> and <td>: the structure, none of the noise. Your own CSS then controls how it looks, which is exactly what you want on a real site.

HTML or Markdown: which to pick

The two formats suit different destinations:

FormatBest for
HTMLWeb pages, CMS articles, anywhere you control the CSS
MarkdownREADME files, GitHub and GitLab, wikis, docs sites

If you are publishing to a website or a content system that accepts raw HTML, use the HTML output and let your stylesheet handle the appearance. If you are writing documentation in Markdown (a README.md, a docs page, a wiki entry), the Markdown table renders natively there with no HTML needed.

Both treat the first row as the header by default. In HTML that means a <thead> with <th> cells, which is correct for accessibility and styling. In Markdown it adds the --- divider line beneath the headings. If your sheet has no header row, turn the header option off and every row is treated as data.

How to convert a sheet to a table

Step 1: Open the workbook

Drop your .xlsx or .xls file into the converter and select the sheet.

Step 2: Choose the format and header

Switch between HTML and Markdown, and decide whether the first row is a header.

Step 3: Copy the markup

Copy the output straight into your page, README or wiki. Special characters like <, > and & are escaped in HTML, and pipe characters are escaped in Markdown, so nothing breaks the table.

Common mistakes to avoid

  • Pasting Excel’s own HTML. It works, but the bloat will haunt you the first time you try to restyle the table. Start from clean markup.
  • Using HTML where Markdown is expected. Raw HTML inside a Markdown file sometimes renders and sometimes does not, depending on the platform. If your destination is Markdown, use the Markdown output.
  • Forgetting to escape special characters by hand. If you build a table manually, an unescaped < or | can break it. Converting handles that escaping for you.

If your table is really destined for a data import rather than display, CSV is usually the better target. See how to convert Excel to CSV.

Frequently asked questions

Why not just copy cells from Excel into my web page?
Pasting from Excel into a visual web editor brings along heavy inline styles and proprietary attributes that bloat the page and are tedious to clean up. Converting instead gives you a plain, semantic table (just rows and cells), so your markup stays small and you can style it with your own CSS.
What is the Markdown table option for?
Markdown tables render on GitHub, GitLab, most wikis and many documentation systems. If you are writing a README or docs page, the Markdown output gives you a table that displays correctly there using no HTML at all.
Does the first row become a header?
Yes, by default. The first row is treated as the table header, so the HTML uses a proper thead with th cells and the Markdown adds its divider row. If your sheet has no header row, you can turn that off and every row is treated as data.
Will the HTML be styled?
No, and that is the point. The output is a clean, unstyled table so it inherits your site's CSS. You add whatever borders, padding and colours you want, rather than fighting Excel's inline styling.
Is my workbook uploaded?
No. The sheet is read and converted on your own device. Nothing is uploaded or stored.

Ready to try it?

Turn a sheet into a clean HTML or Markdown table. Free, in-browser, and 100% private — your data never leaves your device.

Open the Excel to HTML & Markdown Table