XlsxToHtmlConverter 2.1.1

dotnet add package XlsxToHtmlConverter --version 2.1.1
                    
NuGet\Install-Package XlsxToHtmlConverter -Version 2.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="XlsxToHtmlConverter" Version="2.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="XlsxToHtmlConverter" Version="2.1.1" />
                    
Directory.Packages.props
<PackageReference Include="XlsxToHtmlConverter" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add XlsxToHtmlConverter --version 2.1.1
                    
#r "nuget: XlsxToHtmlConverter, 2.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package XlsxToHtmlConverter@2.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=XlsxToHtmlConverter&version=2.1.1
                    
Install as a Cake Addin
#tool nuget:?package=XlsxToHtmlConverter&version=2.1.1
                    
Install as a Cake Tool

XlsxToHtmlConverter v2.1.1

Language .NET .NET Standard NuGet Downloads Commits Since License

A fast, versatile, and powerful XLSX to HTML converter. Support an extensive scope of cell stylings and additional elements. Empower the efficient transformation of spreadsheets into well-structured web documents. Provide the ability to easily customize every aspect of the conversion process with progress callbacks. Only depend on the Open XML SDK.

Dependencies

Features

  • Cell structures, sizes, fonts, fills, borders, alignments, and visibilities
  • Content presentation with number formats and basic conditional formats
  • Elements of pictures and shapes with responsive positioning
  • HTML construction with configurable details and modernized organization
Original XLSX File
Original XLSX File
Converted HTML File
Converted HTML File

Versioning

For versions ≥ 2.0.0, the versioning of XlsxToHtmlConverter conforms to the following scheme:

Generation Major Minor
2 . 1 . 1
(backward-incompatible) (backward-incompatible) (backward-compatible)
Significant codebase refactors. Severe bug fixes and core improvements. Mild changes.

The changelogs are available at the Releases.

How to Use

Only one line to convert a local XLSX file to HTML:

XlsxToHtmlConverter.Converter.Convert(@"C:\path\to\input.xlsx", @"C:\path\to\output.html");

Similarly, the use of Stream is supported:

Stream input = ...;
Stream output = ...;
XlsxToHtmlConverter.Converter.Convert(input, output);

Alternatively, the input may also be a DocumentFormat.OpenXml.Packaging.SpreadsheetDocument instance:

using DocumentFormat.OpenXml.Packaging;
SpreadsheetDocument input = ...;
Stream output = ...;
XlsxToHtmlConverter.Converter.Convert(input, output);

Conversion Configuration

A third optional parameter can be set to configure the conversion process:

XlsxToHtmlConverter.ConverterConfiguration configuration = new()
{
    BufferSize = 65536,
    Encoding = Encoding.UTF8,
    NewlineCharacter = "\n",
    TabCharacter = new(' ', 2),
    RoundingDigits = 2,
    CurrentCulture = CultureInfo.CurrentCulture,
    HtmlTitle = null,
    HtmlPresetStylesheet = ...,
    XlsxSheetSelector = null,
    ConvertSheetTitles = true,
    ConvertSizes = true,
    ConvertVisibilities = true,
    ConvertStyles = true,
    ConvertNumberFormats = true,
    ConvertPictures = true,
    ConvertShapes = true,
    UseHtmlFragment = false,
    UseHtmlClasses = true,
    UseHtmlHexColors = true,
    UseHtmlProportionalWidths = true,
    UseHtmlDataElements = true,
    ...
};
XlsxToHtmlConverter.Converter.Convert(..., ..., configuration);

Progress Callback

A fourth optional parameter can be set to add a progress callback event handler:

XlsxToHtmlConverter.Converter.Convert(..., ..., ..., HandleProgressChanged);
private void HandleProgressChanged(DocumentFormat.OpenXml.Packaging.SpreadsheetDocument? sender, XlsxToHtmlConverter.ConverterProgressChangedEventArgs e)
{
    string summary = $"Sheet {e.CurrentSheet} of {e.SheetCount} | Row {e.CurrentRow} of {e.RowCount}";
    string progress = new string('█', (int)Math.Round(e.ProgressPercentage / 100.0 * 50)).PadRight(50, '░');
    Console.Write($"{e.ProgressPercentage:F2}% ({summary}) {progress}");
}

License

This project is under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.1 893 2/10/2026
2.1.0 107 2/8/2026
2.0.0 398 1/10/2026