I repeat this frequently in the AI courses I teach to companies : data is the driving force behind many business decisions, and the ability to share information efficiently and accessibly is critical.
With this in mind, you’ll understand the importance of knowing tools that easily convert data from one format to another. Today I’m going to tell you about a tool that allows you to convert Excel spreadsheets to HTML code , something that can be very useful in a variety of contexts, from presenting reports to integrating data into web pages.
Why convert Excel to HTML?
Converting Excel tables to HTML has multiple practical applications:
- Website Integration : Directly into the code of a web page, where updated data from spreadsheets needs to be displayed.
- Email : Send data in a format that can be viewed directly from the email client, without having to open attachments.
- Compatibility and Accessibility : HTML is a format compatible with virtually all browsers and devices, making it easy to access information without the need for specific software.
- Report Automation : Automate the generation of reports that are updated regularly and need to be published in a standard format on intranets or the Internet.
How to convert from Excel to HTML
The conversion can be done manually or using automated tools. Manually, it involves saving the table as a web page from Excel, which generates an HTML file representing the original table. However, this method can include a lot of unnecessary code and doesn’t always respect the original design.
On the other hand, automated tools, such as Google Apps Scripts in Google Sheets or libraries in Python and JavaScript, offer finer control over the final result, even allowing you to maintain specific styles and formats.
A tool developed in Google Apps Script (GAS) can automate and simplify this process. This code allows you to create custom scripts that integrate with Google applications. Below, we describe how to use a GAS-based tool to convert Excel spreadsheets (previously imported into Google Sheets) to HTML. Instructions can be found at this link :
Preparing the Spreadsheet :
- Import your Excel file into Google Sheets.
- Make any necessary adjustments to the data.
Access to the Script :
- Open the Google Apps Script editor from Google Sheets via
Extensiones > Apps Script. - Upload or write a script that reads cell data and styles to generate corresponding HTML.
Execution and Customization :
- Runs the script to convert the selected table to HTML.
- Modify the script as needed to include additional styles, such as borders or specific colors.
Exporting and Using HTML :
- The script generates HTML code that you can copy and paste wherever you need, such as into the body of an email or the HTML of a website.
Converting Excel spreadsheets to HTML can significantly improve the efficiency of data communication and presentation, and with this script, it’s a piece of cake.

