UniversalOffice.Xlsx 0.9.2

dotnet add package UniversalOffice.Xlsx --version 0.9.2
                    
NuGet\Install-Package UniversalOffice.Xlsx -Version 0.9.2
                    
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="UniversalOffice.Xlsx" Version="0.9.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="UniversalOffice.Xlsx" Version="0.9.2" />
                    
Directory.Packages.props
<PackageReference Include="UniversalOffice.Xlsx" />
                    
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 UniversalOffice.Xlsx --version 0.9.2
                    
#r "nuget: UniversalOffice.Xlsx, 0.9.2"
                    
#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 UniversalOffice.Xlsx@0.9.2
                    
#: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=UniversalOffice.Xlsx&version=0.9.2
                    
Install as a Cake Addin
#tool nuget:?package=UniversalOffice.Xlsx&version=0.9.2
                    
Install as a Cake Tool

UniversalOffice.Xlsx

Excel workbooks in pure .NET (net8.0), with no native dependencies and no Office install:

  • Read .xlsx losslessly: sheets, cells, shared and rich strings, styles, theme colors, merges, column widths, row heights, hyperlinks, comments, conditional formats.
  • Format values like Excel (Format.FormatValue): number, date, time, percent, fraction and custom format codes (pt-BR locale by default, configurable through FormatLocale).
  • Update a worksheet surgically without touching the rest of the package.
  • Export to CSV/TSV, Markdown, HTML, ODS (OpenDocument), SpreadsheetML 2003 and PDF.

Depends only on UniversalOffice.Core.

Install

dotnet add package UniversalOffice.Xlsx

Read

using UniversalOffice.Xlsx;

var package = XlsxPackage.Load(bytes);
var workbook = XlsxReader.ReadWorkbook(package);
foreach (var sheet in workbook.Sheets)
{
    var worksheet = XlsxReader.ReadWorksheet(package, sheet.Target!);
    Console.WriteLine($"{sheet.Name}: {worksheet.Rows.Count} rows");
}

// "12,5%": the default locale is pt-BR; pass new FormatOptions { Locale = … } for another one
var shown = Format.FormatValue(0.125, "0.0%").Text;

Export

using UniversalOffice.Export;
using UniversalOffice.Pdf;

string csv = XlsxCsv.ToCsv(bytes, new SheetExportOptions { SheetName = "Sales" });
string markdown = XlsxMarkdown.ToMarkdown(bytes);
string html = XlsxHtml.ToHtml(bytes, fullDocument: true);
byte[] ods = XlsxOds.ToOds(bytes);
string xml2003 = XlsxXml2003.ToXml2003(bytes);

// PDF: the generator has no built-in fonts, pass at least one TTF
byte[] pdf = XlsxPdf.ToPdf(bytes, new SheetPdfOptions
{
    Fonts = [new PdfFontSource { Bytes = File.ReadAllBytes("LiberationSans-Regular.ttf") }],
});

License

MIT.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
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
0.9.2 45 10/30/2026
0.9.1 47 10/30/2026