Apps & Software

How to Turn an Excel Sheet into an HTML Table

Learn how to convert an Excel sheet into an HTML table, including simple copy-and-paste methods, exporting options, and how to keep formatting clean for webpages or emails.

Chris Anderson
Chris Anderson
How-To Writer  •  Sep 19, 2026  •  7 min read

Converting an Excel sheet to an HTML table is useful when you want to publish spreadsheet data on a website, share it in an email, or embed it in a page without sending the original workbook. The right method depends on whether you need a quick one-time table, clean HTML for a webpage, or a repeatable workflow.

Excel does not have one single “save as HTML table” button that fits every situation perfectly, but there are several practical ways to get the job done. Some methods preserve formatting, while others produce cleaner code that is easier to edit later.

How to Turn an Excel Sheet into an HTML Table

Choose the Right Conversion Method

Before you start, decide what you want the HTML table to do. If you only need to paste a table into a web editor or content management system, a direct copy-and-paste method may be enough. If you need reusable HTML code, exporting from Excel or using a script may be better.

Why It Matters The method you choose affects both the appearance and the cleanliness of the HTML. Some approaches keep Excel’s exact formatting but create bulky code, while others produce simpler tables that are easier to style on a website.

Method 1: Copy the Excel Range and Paste as HTML

This is the quickest way to move a table from Excel into a web page, content editor, or HTML-capable email editor. Many editors automatically convert pasted spreadsheet data into a table or preserve the table structure if you paste into a rich text field.

  1. Open the worksheet and select the range you want to convert.
  2. Press Ctrl+C to copy the cells.
  3. Open your HTML editor, CMS, or email editor.
  4. Paste the copied content into a rich text area or table editor.
  5. Check whether the editor created a table automatically or whether you need to use a paste-as-HTML option.

If the destination supports rich text, this method is often enough. However, it may not give you direct control over the HTML markup, and some editors strip formatting or convert the table in unexpected ways.

Quick Tip If your editor has a special paste option such as “Paste and Match Style” or “Paste as HTML,” test it with a small sample first to see how it handles borders, fonts, and merged cells.

Method 2: Save the Excel File as an HTML Web Page

Excel can export a workbook or worksheet as an HTML file. This is useful when you want Excel to generate the table structure for you without manually writing tags.

  1. Open the workbook in Excel.
  2. Go to File and choose Save As or Save a Copy.
  3. Select a location for the file.
  4. In the file type or format menu, choose Web Page or HTML, depending on your version of Excel.
  5. If prompted, choose whether to export the entire workbook or the active sheet.
  6. Save the file.

Excel will create an HTML file that includes the table and may also create supporting files for styles or images. This can work well for internal pages or simple published tables, but the output is often more complicated than hand-written HTML.

Warning Excel-generated HTML can include extra styling, hidden table wrappers, and support files. If you need clean code for a website, review the output before publishing it.
Note The exact menu names can vary slightly between Excel for Windows, Excel for Mac, and Microsoft 365.

Method 3: Copy from Excel and Paste into an HTML Editor

If you want to create an HTML table manually, you can copy the data from Excel and then paste it into a code editor or HTML generator. This approach gives you more control over the final markup.

  1. Copy the desired cells from Excel.
  2. Open a plain text editor or HTML editor.
  3. Create a basic table structure with <table>, <tr>, <th>, and <td> tags.
  4. Paste or type the cell values into the matching table cells.
  5. Add borders, spacing, or CSS styling as needed.

This method takes more effort, but it is ideal when you care about clean, lightweight HTML. It also makes it easier to apply consistent styling across a website instead of relying on Excel’s formatting.

Key Fact An HTML table uses <table> for the whole table, <tr> for each row, <th> for header cells, and <td> for normal data cells.

Method 4: Use a Spreadsheet-to-HTML Tool or Script

If you need to convert Excel sheets to HTML tables regularly, automation is usually the best option. You can use a macro, a script, or a dedicated conversion tool to generate HTML from spreadsheet data.

Automation is especially useful when the same workbook is updated often and the HTML table must stay in sync. It can also help if you need to convert several sheets at once.

Best For People who publish recurring reports, maintain data pages, or need to regenerate HTML tables from updated spreadsheets.

How to Keep the HTML Table Clean and Readable

Excel data does not always translate neatly into HTML. To get a better result, it helps to simplify the spreadsheet before conversion.

Why It Matters Cleaner spreadsheets usually produce cleaner HTML. A table that looks good in Excel can become cluttered or difficult to maintain once it is turned into web markup.

If You Need the Table for a Website

When the end goal is a webpage, think beyond the conversion itself. The table should also be easy to style and maintain after it is added to the site.

Quick Tip If the table is wide, test how it behaves on a mobile screen before publishing it. A table that looks fine on desktop can become hard to read on small devices.

Common Problems When Converting Excel to HTML

A few issues come up often during conversion, especially when the source spreadsheet is heavily formatted.

Warning If your spreadsheet contains sensitive data, be careful with online converters or any process that creates a publicly accessible HTML file.

A Simple Example of the Result

A basic HTML table generated from Excel data usually looks like this:

<table> <tr> <th>Name</th> <th>Department</th> <th>Score</th> </tr> <tr> <td>Ana</td> <td>Sales</td> <td>92</td> </tr> <tr> <td>Mark</td> <td>Support</td> <td>88</td> </tr> </table>

This is the kind of structure you want if you are aiming for simple, editable HTML. From there, you can add CSS for borders, spacing, colors, and responsiveness.

Which Method Should You Use?

If this is a one-time task, Excel’s built-in export options are usually the easiest. If you plan to reuse the table on a live website, manual HTML or automation often gives better long-term results.

Topics

More from Apps & Software

View all →
Virtual Machine Showdown: Performance, Features, and the Best Uses for Each
Apps & Software

Virtual Machine Showdown: Performance, Features, and the Best Uses for Each

5 Ways to Fix HP Support Assistant When It Won’t Install
Apps & Software

5 Ways to Fix HP Support Assistant When It Won’t Install

Fixing Format Painter in Microsoft Office When It Stops Working
Apps & Software

Fixing Format Painter in Microsoft Office When It Stops Working

Why the Microsoft Teams Banner Sparked So Much Backlash
Apps & Software

Why the Microsoft Teams Banner Sparked So Much Backlash

How to Fix a Google Chrome Download Stuck at 100%
Apps & Software

How to Fix a Google Chrome Download Stuck at 100%

Microsoft Teams Error Code 42b: What It Means and How to Fix It
Apps & Software

Microsoft Teams Error Code 42b: What It Means and How to Fix It