To convert Excel data to an HTML table in Microsoft 365 for Windows, select the cells if you only need a range, then choose File > Save As > Browse, set Save as type to Web Page (*.htm; *.html), and publish the selection or workbook. For a one-off transfer, copy the cells and paste them into an HTML-capable editor; whichever method you use, inspect the result in a browser before publishing it.
What an Excel-to-HTML conversion does
HTML is the markup used to describe content on web pages. A table in HTML is made from rows and cells, with tags that can identify headings and data. When Excel saves a worksheet as a web page, it translates the selected spreadsheet content into HTML and related files that a browser can display. It does not turn the web page into a live spreadsheet.
That distinction matters. Excel formulas, sorting, filters, and data validation are spreadsheet features. A saved HTML page usually shows the displayed values and some presentation, but visitors cannot recalculate formulas or edit the data as they could in Excel. If the goal is simply to show a price list, schedule, or product comparison on a website, static HTML may be suitable. If visitors need to edit or analyze the data, choose a spreadsheet-sharing or web-application approach instead.
For example, a worksheet might contain a product name, quantity, and price. The exported page can show those columns in a browser, but it will not automatically update when someone changes the workbook on their computer. Updating the web page requires publishing a new version or setting up a separate process that serves current data.
Export a workbook as a web page in Excel for Windows
In Excel for Microsoft 365 on Windows, the built-in Web Page format is a straightforward way to create an HTML file from a workbook or a chosen part of it. The exact dialog layout can differ slightly between builds, but the general process is:
- Open the workbook and save a separate copy if you want to preserve the original file unchanged.
- If you want only part of a sheet, select the cell range first. Otherwise, plan to publish a whole sheet or the workbook.
- Choose File > Save As > Browse. In the Save as type list, choose Web Page (*.htm; *.html).
- Choose a file name and location. If the Save As dialog offers a Publish button, use it to open the publishing options.
- In the publishing options, choose whether to publish the selection, a worksheet, or the workbook, as available. Check the items shown in the dialog before confirming.
- Select Publish, then open the resulting .htm or .html file in a browser and check the displayed table.
Excel may create a supporting folder alongside the HTML file, particularly when the page includes images or other resources. Keep that folder with the web page when moving or uploading the files; separating it can leave images or other page elements missing. Avoid renaming or deleting supporting files unless you know the page does not rely on them.
Saving a workbook in Web Page format is different from saving it as an Excel workbook. Keep your working .xlsx file as the editable source, and treat the HTML as a published output. If Excel asks whether to continue using the web-page format after publishing, choose based on whether you intend to keep editing the workbook in Excel; the web page itself is not a substitute for the workbook.
Publish just a selected range
A selected range is often best when a worksheet contains notes, calculations, or unrelated data that should not appear on the site. Select the intended rectangle of cells before opening Save As. In the publishing dialog, choose the option for the selection rather than the entire workbook, if that choice is available. Check the range boundaries carefully: a blank row or column included in the selection may become part of the output, while a needed heading left outside it may be omitted.
Before publishing, make the range self-explanatory. Include clear column headings, remove temporary notes, and decide whether totals belong in the table. A range such as A1:C12 might be appropriate for a three-column inventory, while a broad selection that includes calculations off to the right can expose content that was not intended for readers. The saved page will not know which cells you consider private or irrelevant; the published selection determines what is included.
If the publishing dialog does not offer the selection you expect, cancel rather than assuming the right cells were exported. Recheck the highlighted range, then open the publishing options again. Because dialog options can depend on the selected object and Excel build, verify the resulting page rather than relying only on the selection shown in the worksheet.
Copy cells into an HTML editor
For a quick, small table, copying cells from Excel and pasting them into a web content editor may be faster than saving a whole page. Some editors accept formatted content from the clipboard and convert it into a web table; others paste plain text, create a spreadsheet embed, or reject the formatting. The result depends on the editor, browser, and publishing platform, so this is not a universal way to obtain clean HTML source code.
If you need actual HTML markup, paste into an editor that has an HTML or source-code view and inspect what it produces. A basic table might be structured like this:
<table>
<thead>
<tr><th>Product</th><th>Quantity</th></tr>
</thead>
<tbody>
<tr><td>Notebook</td><td>12</td></tr>
</tbody>
</table>
The tags identify a table, its heading row, and a data row. In a real website, CSS can control fonts, spacing, borders, and mobile presentation independently of the spreadsheet. Hand-editing or rebuilding the table in HTML is more work, but it can produce cleaner code than importing a complex worksheet with merged cells, decorative formatting, or many unused rows.
What formatting and spreadsheet features carry over?
Expect the page to preserve enough appearance to communicate the data, not to reproduce every Excel behavior exactly. Cell text, basic layout, and some formatting may be represented, but the browser and website styles can change how the result looks. Fonts may differ if they are unavailable on the visitor’s device, and wide tables can require horizontal scrolling on a phone. Test the HTML in the actual location where it will be used.
Formulas are not a reliable way to deliver an interactive calculation through a static HTML export. The page presents spreadsheet content for viewing; it does not run Excel’s calculation engine. A formula cell may show its current displayed result, but visitors cannot change an input and expect the result to recalculate as it would in the workbook. Likewise, Excel features such as filters, conditional formatting, charts, and merged cells may not behave or appear exactly as they do in the worksheet.
For an accessible table, use a clear header row and keep the structure simple. Screen readers and other assistive technologies benefit when column headings are identifiable and the relationships between headings and data are straightforward. Avoid relying on color alone to communicate meaning; for instance, label a status as “Delayed” instead of distinguishing it only with a red fill. After export, review the page at different screen widths and, where practical, check that headings remain understandable.
Choose the right method for the job
The best route depends on whether you need a static snapshot, editable content, or an automatically updated display. Consider these common cases:
- One-time table for a webpage: Export only the relevant selection, then review the HTML and any supporting files.
- Small table in a content editor: Try copying and pasting, then confirm that the editor created a proper table and retained the headings.
- Data that readers must edit: Share the workbook using an appropriate Microsoft 365 sharing option rather than presenting a static HTML export.
- Frequently changing data: Use a publishing workflow designed to refresh the web display, or update and republish the exported page when the source changes.
- Custom design or accessibility requirements: Rebuild or refine the table in HTML and CSS so its structure and presentation can be controlled directly.
Excel’s Web Page option is convenient for a snapshot, but it is not a full website authoring system. If the exported page contains more styling or files than your web platform accepts, a simpler manually authored table may be easier to maintain. If the numbers need to remain current, determine who will update the page and how changes will be reviewed before choosing a static export.
Review privacy and publishing risks
Publishing a spreadsheet is a content-disclosure decision, not just a file-format change. Before exporting, inspect the selected cells and the resulting page for personal information, internal notes, hidden calculations, and details that should not be public. Do not assume that content outside the visible portion of the worksheet is automatically excluded in every publishing workflow. Choose the intended range or sheet explicitly and inspect the generated files before uploading them.
HTML pages and their accompanying resources may be easier to share than a workbook, but they still need to be stored and hosted appropriately. Use the permissions and review procedures of the destination website. If the page is public, anyone who can reach it may be able to read its contents. For sensitive information, do not rely on obscuring a page link or hiding a worksheet as a privacy control; publish only information approved for that audience.
Also consider whether the page could mislead readers by looking current when it is not. Include a visible “last updated” date when freshness matters, and replace the published output when the source data changes. A saved HTML file does not automatically stay synchronized with the workbook simply because both files remain in the same folder.
Common problems and practical fixes
- The page is missing images: Check whether Excel created a supporting folder and upload or move it with the HTML file.
- The table is too wide: Reduce unnecessary columns, shorten headings, or ask the website administrator to apply responsive table styling.
- The page shows unexpected cells: Re-export after selecting the intended range and confirming the publishing choice.
- Formatting changes on the website: The site’s CSS may override imported styles. Use the site’s table tools or adjust the HTML/CSS rather than expecting the spreadsheet appearance to be exact.
- Values look out of date: Reopen the workbook, update its data and calculations, then publish a fresh HTML version and verify it in the browser.
- The editor pastes plain text: Use its table-insertion or source-code features, or export the range and adapt the resulting markup.
When diagnosing a problem, compare the exported file opened locally with the same file after it has been uploaded. If it looks right locally but wrong online, the website’s editor, styles, or file handling may be changing it. If the local version is already wrong, revisit the selected range and workbook formatting before publishing again.
Frequently Asked Questions
Can Excel convert a spreadsheet directly to HTML?
Yes. In Excel for Microsoft 365 on Windows, use File > Save As and choose Web Page (*.htm; *.html), then publish the selection, sheet, or workbook offered in the dialog. Review the output in a browser because it is a static web page, not an interactive Excel workbook.
How do I convert only certain Excel cells to HTML?
Select the desired cell range before using Save As and choose the selection in the publishing options, when available. Check the resulting page to confirm that it includes the intended headings and excludes unrelated cells.
Will an Excel HTML table update when the workbook changes?
Not automatically just because you saved an HTML file. Treat the exported page as a snapshot unless you have set up a separate publishing process that refreshes it. Otherwise, update the workbook and publish a new version when the data changes.
Can I paste an Excel table into a website?
Often, but the result depends on the website editor. Some convert copied cells into a formatted table; others paste plain text or use their own import behavior. Inspect the page after pasting, especially its headings, spacing, and mobile layout.
Does exporting to HTML preserve Excel formulas?
It does not make formulas interactive in the browser. A static export can display the values shown in Excel, but visitors cannot edit inputs and recalculate them with Excel’s formula engine. Keep the workbook or build a separate interactive tool if calculation is required.
Related
- table() in RStudio: How It Counts and Displays Data
- Data Validation and Reconciliation in Excel Explained
- PowerPoint Table Diagonal Split Cell: Practical Methods
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Find Year in Excel: Extract a Year from a DateTo find the year in an Excel date, enter =YEAR(A2) in an empty cell, replacing A2 with the…
- Track Changes Bar in Word: What It Means and How to Use ItIn Microsoft Word, the Track Changes bar usually means the vertical line in the page margin beside text…
- Duplicates in Google Sheets: Copy Cells and Rows SafelyTo put duplicate data in Google Sheets, select the cells or row you want to copy, press Ctrl+C,…
- Google Sheets Monthly Timesheet TemplateYes—you can make a monthly timesheet template in Google Sheets by setting up columns for date, employee, start…
- Expenses Tracker in Google Sheets: Setup and TipsYes—you can make an expenses tracker in Google Sheets by recording each transaction in a table, then using…
- Copy Data Validation to Other Cells in Microsoft ExcelTo copy data validation in Excel, copy a cell that already has the rule, select the destination cell…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.