IRONSOFTWAREHOME
Convert Excel to HTML
using IronXL;
using IronXL.Options;

WorkBook workBook = WorkBook.Load("sample.xlsx");

var options = new HtmlExportOptions()
{
    // Set row/column numbers visible in html document
    OutputRowNumbers = true,
    OutputColumnHeaders = true,

    // Set hidden rows/columns visible in html document
    OutputHiddenRows = true,
    OutputHiddenColumns = true,

    // Set leading spaces as non-breaking
    OutputLeadingSpacesAsNonBreaking = true
};

// Export workbook to the HTML file
workBook.ExportToHtml("workBook.html", options);
Imports IronXL
Imports IronXL.Options

Dim workBook As WorkBook = WorkBook.Load("sample.xlsx")

Dim options = New HtmlExportOptions() With {
    .OutputRowNumbers = True,
    .OutputColumnHeaders = True,
    .OutputHiddenRows = True,
    .OutputHiddenColumns = True,
    .OutputLeadingSpacesAsNonBreaking = True
}

' Export workbook to the HTML file
workBook.ExportToHtml("workBook.html", options)
NuGet Download
PM > Install-Package IronXL.Excel
Convert Excel to HTML

Convert Excel to HTML

The code example above demonstrates how to convert Excel to HTML using C#. The HtmlExportOptions class is used to customize how the HTML output is generated. The available options are:

  • OutputRowNumbers property: Indicates whether to show row numbers in the resulting HTML file.
  • OutputColumnHeaders property: Indicates whether to show column headers in the resulting HTML file.
  • OutputHiddenRows property: Indicates whether to display hidden rows in the resulting HTML file.
  • OutputHiddenColumns property: Indicates whether to display hidden columns in the resulting HTML file.
  • OutputLeadingSpacesAsNonBreaking property: Indicates whether to show leading spaces (extra spaces before the first character in a cell) as non-breaking spaces in the resulting HTML file.
Discover more Excel file type conversions with IronXL.
View on GitHub

Ready to Get Started?

Nuget Downloads 2,237,574Version: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