Save HTML as Excel: Quick Step-by-Step Guide
In this article
You can save an HTML file as an Excel spreadsheet to organize tabular data into rows and columns for analysis, reporting, or sharing. This works because Excel can interpret basic HTML table structures and convert them into a functional .xlsx or .xls file. No special software is required—just a modern web browser and Microsoft Excel (or compatible software like Google Sheets or LibreOffice Calc). The process is useful when you’ve copied table data from a website or generated a report in HTML and need to manipulate it numerically or visually in Excel.
What You'll Need
- A web browser (Chrome, Firefox, Edge, or Safari)
- An HTML file containing a properly structured table (<table>, <tr>, <td> elements)
- Microsoft Excel (2010 or later), Google Sheets, or LibreOffice Calc
- Access to your computer’s file system to save and open files
Step-by-Step
- Open the HTML file in your web browser by double-clicking it or dragging it into the browser window. Ensure the table displays correctly with all rows and columns visible.
- Once the page loads, click the browser’s menu (three dots in Chrome/Edge, three lines in Firefox, or the Safari menu) and select Save Page As (or Save As).
- In the Save dialog, choose a location on your computer where you want to store the file, such as your Desktop or Documents folder.
- Set the Save as type or Format dropdown to Web Page, Complete (this saves the HTML and associated files) or Web Page, HTML Only (recommended—this saves just the HTML without extra assets like images or CSS, reducing confusion).
- Click Save. The file will have a .html extension, such as
report.html. - Open Microsoft Excel (or your preferred spreadsheet program).
- In Excel, go to File > Open.
- Navigate to the folder where you saved the HTML file, select it, and click Open.
- Excel will detect the HTML table and display a dialog titled Import Data. Confirm that the correct table is selected (if multiple tables exist on the page, choose the one you want).
- Click OK. Excel will import the data into a worksheet, preserving column and row structure.
- Once imported, review the data. Excel may misinterpret some content (like merged cells or non-standard formatting), so check for alignment, number formats, or text that appears as numbers.
- Click File > Save As, choose a location, and select Excel Workbook (*.xlsx) as the file type.
- Give the file a meaningful name (e.g.,
sales_data.xlsx) and click Save.
Common Mistakes
- Trying to rename a .html file directly to .xlsx—this does not convert the file and will corrupt it. Always open the HTML in Excel first.
- Using HTML with complex CSS, JavaScript, or non-table elements (like divs or spans styled to look like tables). Excel only imports actual <table> structures reliably.
- Not checking for merged cells or inconsistent column counts across rows, which cause Excel to shift data or leave blank columns.
- Assuming images, hyperlinks, or formatting from the original HTML will transfer cleanly. Excel strips most styling and only retains basic cell content.
- Opening the HTML file in Excel by double-clicking it instead of using File > Open. Double-clicking may open it in a browser instead of Excel, especially if the file association is incorrect.
Tips
- Before saving as HTML, validate the table structure using an online HTML validator to ensure it has proper <thead>, <tbody>, and matching <tr> and <td> tags.
- If the HTML contains multiple tables, delete all unwanted tables from the source file before saving—it simplifies import and avoids confusion in Excel.
- Use plain text in table cells. Avoid special characters like commas or line breaks inside data unless you’re prepared to clean them up later in Excel using Find & Replace.
- For large datasets, consider exporting directly from the source system as CSV if possible—it’s more reliable than HTML-to-Excel conversion.
- After importing, select the entire data range in Excel and apply Data > Text to Columns if numbers appear as text or if delimiters were misinterpreted.
- Use Excel’s Format as Table option after import to enable filtering and improve readability.
Troubleshooting
- Excel says the file is corrupted or cannot open it: Open the HTML file in a text editor like Notepad. Check if it contains valid HTML with a <table> tag. If it’s blank or contains only JavaScript, the file was not generated properly. Re-save the page from the browser using the correct format.
- Only one row imports or data is jumbled: The HTML table may be malformed. Check for missing </tr> or </td> tags. Use browser developer tools (right-click on the table and select Inspect) to verify the structure.
- Numbers appear as text with a green triangle in Excel: Select the affected cells, click the warning icon, and choose Convert to Number.
- Excel opens the file in a browser instead of the app: Right-click the HTML file, select Open With, then choose Excel from the list. Check Always use this app to open .html files if you want to change the default behavior.
- Formatting is lost (colors, fonts, borders): This is normal. Excel imports only data, not visual styling. Reapply formatting manually after import if needed.
- Nothing imports at all: The file might not contain a table. Verify the HTML source has <table> elements. If it’s just paragraphs or divs, conversion won’t work—you need tabular data.