Smart Systems for Home

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

Convert HTML Table to Excel

· 5 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 easily turn an HTML table into a usable Excel spreadsheet. The fastest method is to copy the table from your web browser and paste it directly into Excel. This method preserves the most data and formatting, but it requires a specific browser setting to be enabled for the best results.

What You'll Need

  • A computer with a web browser (Chrome, Edge, Firefox, Safari).
  • A Microsoft Excel application installed (Office 365, Excel 2021, or Excel 2020) or the free Excel for the Web.
  • A web page containing the data you wish to export.

Step-by-Step

  1. Navigate to your data source. Open your web browser and go to the page that contains the HTML table you want to export. Ensure the table is fully loaded and visible on the screen.
  2. Select the table. Click your mouse cursor inside the HTML table you want to copy. Click and drag to highlight the entire table, including the header row. The text will be highlighted in blue to show it has been selected.
  3. Copy the data. With the table highlighted, press Ctrl + C on your keyboard (or Cmd + C on a Mac) to copy the data to your clipboard. Alternatively, right-click the highlighted text and select “Copy” from the context menu.
  4. Open Excel. Launch the Microsoft Excel application on your computer. If you are using Excel for the Web, open your browser and navigate to the Excel website, then create a new blank workbook.
  5. Paste the data. In the blank Excel sheet, click on the top-left cell (cell A1) where you want the data to start. Press Ctrl + V (or Cmd + V on a Mac) to paste the data. You will see a small pop-up icon appear near the bottom-right corner of the pasted data.
  6. Choose the paste options. Click the pop-up icon. You will see several options. Select “Match Destination Formatting”. This is the crucial step. This option tells Excel to interpret the copied web table as text data rather than HTML code, which prevents the table from breaking apart into multiple separate sheets or cells.
  7. Verify the data. Look at your Excel sheet. The table should appear correctly aligned in a single block. Check the header row to ensure the column titles are in the first row. If any data is missing or in the wrong columns, you may need to adjust the column widths or perform a text-to-columns operation.
  8. Save your file. To save your new Excel file, go to the “File” menu and select “Save As.” Choose a location on your computer, name your file, and select a file format like “Excel Workbook (.xlsx).” Click “Save.”

Common Mistakes

The most common error when converting HTML to Excel is skipping the “Match Destination Formatting” step. If you simply paste without this option, Excel may paste the table as a single image, or it may paste the HTML data into a single cell, breaking the table into separate sheets. Another mistake is not ensuring the table is fully selected. If you do not select the entire table, you may end up with incomplete data. Additionally, if the web page is not fully loaded or if the table is generated by JavaScript after the page loads, the data will not be there to copy.

Tips

For the cleanest export, use the Chrome or Edge browser, as they support the “Match Destination Formatting” option most reliably. If you are pasting into Excel for the Web, the pop-up icon may appear slightly differently, but the “Match Destination Formatting” option is still available in the dropdown menu. If your table is very wide and will not fit on a single screen, you can adjust the column widths after pasting by clicking and dragging the vertical lines between the column letters in the header row.

Troubleshooting

If the data does not paste correctly, the first thing to check is the browser setting. In Chrome, go to Settings > Cookies and other site data > Content settings > JavaScript. Ensure JavaScript is allowed, as some tables require it to load. If the table is blank when you paste, try selecting a smaller section of the table first. If you are using Excel for the Web and the paste options are missing, ensure you are logged into your Microsoft account. If the data looks scrambled or is in a single cell, you likely pasted without selecting the “Match Destination Formatting” option. Simply delete the data, try again, and be sure to click the pop-up icon and select that specific option.

Frequently Asked Questions

Does this method work for all web pages?

No. This method works best for standard HTML tables that are fully loaded when the page opens. It will not work for tables that are generated by JavaScript, tables that are inside a scrollable container, or tables that are images of text rather than actual HTML code.

Can I export a whole web page to Excel?

No. Excel only accepts tabular data. You cannot export a web page that contains text paragraphs, images, and navigation menus. You must find the specific HTML table on the page to export.

Will the formatting be preserved?

The basic structure (rows and columns) will be preserved. However, specific formatting like background colors, font styles, and cell borders may not transfer perfectly. You will typically need to manually adjust the formatting in Excel to match the original web page.

What if the data has commas in it?

Excel is smart enough to handle commas within a cell. If the data has commas separating values (e.g., a list of items), Excel will treat the comma as part of the text in that cell. If you want to separate them into different columns, you can use the “Text to Columns” feature in the Data tab.

How do I export data from a locked or protected web page?

If the website prevents you from selecting text (e.g., by using a content protection script), you cannot copy the data using the standard method. You may need to use the browser’s “Inspect Element” feature to view the underlying HTML code and extract the data manually, though this requires technical knowledge.

Can I do this on a Mac?

Yes. The steps are identical on a Mac. You can use Safari, Chrome, or Firefox. The keyboard shortcuts are Cmd + C to copy and Cmd + V to paste. The “Match Destination Formatting” option is available in all versions of Excel for Mac as well.