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,280,941Version:2026.10just 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 IronXL
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get a Quote, No Obligation
Your details will always be kept confidential.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Trusted by Millions of Engineers Worldwide
Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.10

PM > Install-Package IronXL.Excel
nuget.org/packages/IronXL.Excel/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronXL"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.10

  1. Download and unzip IronXL to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronXL.dll"

Licenses from $999