Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Save Excel Doc as HTML

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can save an Excel spreadsheet as an HTML file. This process converts your grid of data, charts, and basic formatting into code that web browsers can display natively. You do not need any third-party software or plugins to do this; the feature is built directly into Microsoft Excel. The resulting file is a standard HTML document that can be opened in Chrome, Safari, Firefox, or Edge, and it retains the data structure and most formatting elements.

What You'll Need

  • A computer running Microsoft Excel (2010, 2013, 2016, 2019, or Microsoft 365).
  • The Excel file you wish to convert (an .xlsx or .xls file).
  • A web browser installed on your computer to verify the export.

Step-by-Step

  1. Open your Excel workbook. Launch the Microsoft Excel application on your computer and open the specific spreadsheet document you intend to convert. Ensure all the data you want to appear in the HTML file is present and saved.
  2. Locate the "Save As" option. In the upper-left corner of the Excel window, click on the "File" tab. This will open the Backstage view. In the list of options on the left, select "Save As." This will open the Save As dialog box.
  3. Choose the file location. In the dialog box, navigate to the folder on your computer where you want to save the new HTML file. You can use the sidebar on the left to jump to common locations like "Desktop," "Documents," or "OneDrive." Select the specific folder and click the "Browse" button if you need to drill down further.
  4. Select "Web Page (*.htm; *.html)" as the file type. Look at the bottom of the Save As dialog box, where it says "Save as type." Click on the dropdown menu next to this label. Scroll through the list and select "Web Page (*.htm; *.html)." This tells Excel to export the file in a format compatible with the internet.
  5. Confirm the Save As settings. After selecting the file type, you will see a new button appear in the dialog box labeled "Publish." Click this button. This step is crucial. It opens the "Publish as Web Page" dialog, which allows you to specify exactly what part of the workbook you are saving and how it is formatted.
  6. Select the specific sheet or item to publish. In the "Publish As Web Page" dialog, look for the label "Choose a display item." Click the dropdown arrow and select the specific worksheet or chart you want to save. You can choose to save the entire workbook, a specific sheet, or a specific named range if you have defined one.
  7. Choose the title for the webpage. Ensure the "Title" field matches what you want to see when the page opens in a browser. This text usually appears at the very top of the webpage. You can leave the default name or type your own here; it is editable.
  8. Adjust formatting and interactivity settings. Below the title field, you will see options for formatting. Select "Entire spreadsheet" or "Selected sheet(s)." You can also check the box next to "Add interactivity" if you want to allow users to filter data or use a pivot table viewer within the HTML file. However, for a simple, static view of your data, you can leave this unchecked.
  9. Click "Publish." Once you have selected your display item and reviewed your settings, click the large "Publish" button in the bottom-right corner of the dialog box. Excel will now process the workbook and generate the HTML file.
  10. Locate and open your new HTML file. A progress bar may appear briefly. After it finishes, the Publish dialog box will close automatically. Navigate to the folder you selected in Step 3. You will see a file with an .html or .htm extension. Double-click this file to open it in your default web browser. You should see your Excel data rendered as a web page.

Common Mistakes

One of the most frequent errors is failing to click the "Publish" button in Step 5. Many users select the file type and simply click "Save." This action will save the file as an Excel file again, not an HTML file, and the file extension will remain .xlsx. You must explicitly use the Publish feature to get the HTML output. Another mistake is not saving the file in a location you can easily find. Since you are creating a web page, it is best practice to save it directly to your Desktop or a folder dedicated to "Web Content" so you can drag and drop it into an email or upload it to a website later.

Tips

  • Check for broken links. If your Excel spreadsheet contains hyperlinks to external files or websites, these links will not automatically work when you save it as HTML. The hyperlink text will be there, but the destination may be broken. You will need to manually update the URLs in the HTML code if you intend to keep these links functional.
  • Large files may take time. If you are converting a massive spreadsheet with thousands of rows and complex formulas, the publishing process can take several seconds or even minutes. Be patient and do not close Excel prematurely, or the process may be interrupted.
  • Formatting limitations. While Excel does its best to translate styles, it is not a perfect web design tool. Complex conditional formatting, advanced charts, and merged cells may not render exactly as they do in the Excel grid. The resulting HTML page will be a faithful representation of the data, but the visual polish might be slightly different.
  • Use for simple data sharing. The primary use case for saving as HTML is for quick, static data sharing. If you need to create a rich, interactive web application or a complex dashboard, you are better off using a dedicated database and a web development framework, as HTML export is too limited for that scale.

Troubleshooting

If your Excel sheet saves as an HTML file but the data appears jumbled or the page is blank, check your data types. HTML tables require consistent column widths and data alignment. If your Excel sheet has merged cells or wildly varying text lengths, the export function may struggle to align the columns correctly. Try un-merging cells and standardizing the column widths in Excel before attempting to save as HTML again. If the file opens in your browser but the formatting is completely gone, ensure that the "Publish as Web Page" dialog’s formatting settings were selected correctly. If the file simply will not save or gives an error, check your computer’s disk space. If the hard drive is full, the file cannot be written, even if the process appears to start.

Frequently Asked Questions

Can I save an Excel sheet as HTML on a Mac?

Yes, the functionality is available on macOS versions of Excel. The steps are nearly identical: click File > Save As, choose a location, select "Web Page" from the file type dropdown, and click Publish.

Does the HTML file contain formulas?

No. When you save an Excel file as HTML, the formulas are calculated and their results are written into the HTML code. The resulting file contains static numbers, not the formulas themselves.

Can I edit the HTML file with a text editor?

Yes. Since the file is just text, you can open it in Notepad, TextEdit, or any other code editor. However, this is not recommended unless you know how to code in HTML. If you make a mistake in the code, the file may not open correctly in a browser.

Will the chart save with the data?

Yes, if you selected a chart as the "display item" in the Publish dialog box, the chart image will be embedded in the HTML file. However, if you choose to save the entire spreadsheet, the chart will appear as a static image within the grid, and you cannot interact with it like you can in Excel.

Is the file compatible with Google Sheets?

Not directly. Google Sheets does not have a native "Import from HTML" feature that allows you to upload an Excel-exported HTML file to instantly rebuild a Google Sheet. You would need to copy the data from the HTML file and paste it into a new Google Sheet.

Does it work in Excel Online?

Not with the same depth. In Excel Online, you can export a file to PDF or a CSV, but the direct option to save as an HTML web page is not available in the web-based version. This feature is primarily a desktop application function.