IRONSOFTWAREHOME
Convert Excel to HTML
from ironxl import *

# Load the Excel workbook
workbook = WorkBook.Load("sample.xlsx")

# Set up HTML export options
options = HtmlExportOptions()
options.OutputRowNumbers = True
options.OutputColumnHeaders = True
options.OutputHiddenRows = True
options.OutputHiddenColumns = True
options.OutputLeadingSpacesAsNonBreaking = True

# Export workbook to HTML file
workbook.ExportToHtml("workBook.html", options)
pip install ironxl
Convert Excel to HTML

Convert Excel to HTML

The code example above demonstrates how to convert an Excel file to HTML using IronXL for Python. The HtmlExportOptions class is used to customize the HTML output. The available options are:

  • OutputRowNumbers property: Controls whether row numbers are included in the resulting HTML file.
  • OutputColumnHeaders property: Controls whether column headers are included in the resulting HTML file.
  • OutputHiddenRows property: Controls whether hidden rows are displayed in the resulting HTML file.
  • OutputHiddenColumns property: Controls whether hidden columns are displayed in the resulting HTML file.
  • OutputLeadingSpacesAsNonBreaking property: Controls whether leading spaces in cells are rendered as non-breaking spaces in the resulting HTML file.
Discover more Excel file type conversions with IronXL for Python.

Ready to Get Started?

Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required