NanoXLSX 3.0.0

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

NanoXLSX

NanoXLSX

NuGet Version NuGet Downloads GitHub License FOSSA Status

NanoXLSX is a small .NET library written in C#, to create and read Microsoft Excel files in the XLSX format (Microsoft Excel 2007 or newer) in an easy and native way

  • Minimum of dependencies (*
  • ❌ No need for an installation of Microsoft Office
  • ❌ No need for Office interop libraries
  • ❌ No need for proprietary 3rd party libraries
  • ❌ No need for an installation of the Microsoft Open Office XML SDK (OOXML)

🌐 Project website: https://picoxlsx.rabanti.ch

📄 See the Change Log for recent updates.

📦 Modules

NanoXLSX v3 is split into modular NuGet packages:

Module Status Description
NanoXLSX.Core :green_circle: Mandatory, Bundled Core library with workbooks, worksheets, cells, styles. No external dependencies
NanoXLSX.Reader 🔵 Optional, Bundled Extension methods to read/load XLSX files. Depends on Core
NanoXLSX.Writer 🔵 Optional, Bundled Extension methods to write/save XLSX files. Depends on Core
NanoXLSX.Formatting 🔵 Optional, Bundled In-line cell formatting (rich text). External repo. Depends on Core
NanoXLSX ⭐ Meta-Package Bundles all of the above. Recommended for most users

Note: All bundled modules are included when you install the NanoXLSX meta-package. There are currently no non-bundled (standalone) modules.

For advanced scenarios, you can install only the specific packages you need (e.g. NanoXLSX.Core + NanoXLSX.Writer for write-only applications).

✨ What's new in version 3.x

NanoXLSX v3 is a major release with significant architectural changes:

  • Modular architecture - Split into separate NuGet packages (Core, Reader, Writer, Formatting) with a plugin system
  • New Color system - Unified Color class supporting RGB, ARGB, indexed, theme and system colors
  • Redesigned Font and Fill - Font properties now use proper enums; Fill supports flexible color definitions with tint
  • PascalCase naming - All enums and constants follow C# naming conventions
  • Immutable value types - Address and Range structs are now immutable
  • In-line formatting - Rich text cell formatting via the NanoXLSX.Formatting module
  • Utils reorganization - Utils class split into DataUtils, ParserUtils, Validators

⚠️ Breaking changes from v2.x - There are breaking changes between NanoXLSX v2.6.7 and v3.0.0, mostly related to namespace changes and renamed enum values. See the Migration Guide for detailed upgrade instructions.

🗺️ Roadmap

NanoXLSX v3.x is planned as the long-term supported version. Possible future enhancements include:

  • 🔒 Modern password handling (e.g. SHA-256 for worksheet protection)
  • 🎨 Auto-formatting capabilities
  • 🔢 Formula assistant for easier formula creation
  • 🖌️ Modern Style builder API
  • 💬 Support for cell comments
  • 🖼️ Embedded images and charts
  • 🚀 Performance optimizations

📖 Reader Support

The reader of NanoXLSX follows the principle of "What You Can Write Is What You Can Read". Therefore, all information about workbooks, worksheets, cells and styles that can be written into an XLSX file by NanoXLSX, can also be read by it. There are some limitations:

  • A workbook or worksheet password cannot be recovered, only its hash
  • Information that is not supported by the library will be discarded
  • There are some approximations for floating point numbers. These values (e.g. pane split widths) may deviate from the originally written values
  • Numeric values are cast to the appropriate .NET types with best effort. There are import options available to enforce specific types
  • No support of other objects than spreadsheet data at the moment
  • Due to the potential high complexity, custom number format codes are currently not automatically escaped on writing or un-escaped on reading

⚙️ Requirements

NanoXLSX is originally based on PicoXLSX. However, NanoXLSX is now in the development lead, whereas PicoXLSX is a subset of it. The library is currently on compatibility level with .NET version 4.5 and .NET Standard 2.0. Newer versions should of course work as well. Older versions, like .NET 3.5 have only limited support, since newer language features were used.

.NET 4.5 or newer

*)The only requirement to compile the library besides .NET (v4.5 or newer) is the assembly WindowsBase, as well as System.IO.Compression. These assemblies are standard components in all Microsoft Windows systems (except Windows RT systems). If your IDE of choice supports referencing assemblies from the Global Assembly Cache (GAC) of Windows, select WindowsBase and Compression from there. If you want so select the DLLs manually and Microsoft Visual Studio is installed on your system, the DLL of WindowsBase can be found most likely under "c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\WindowsBase.dll", as well as System.IO.Compression under "c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.IO.Compression.dll". Otherwise you find them in the GAC, under "c:\Windows\Microsoft.NET\assembly\GAC_MSIL\WindowsBase" and "c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.IO.Compression"

The NuGet package does not require dependencies

.NET Standard

.NET Standard v2.0 resolves the dependency System.IO.Compression automatically, using NuGet and does not rely anymore on WindowsBase in the development environment. In contrast to the .NET >=4.5 version, no manually added dependencies necessary (as assembly references) to compile the library.

Utility dependencies

The Test project and GitHub Actions may also require dependencies like unit testing frameworks or workflow steps. However, none of these dependencies are essential to build the library. They are just utilities. The test dependencies ensure efficient unit testing and code coverage. The GitHub Actions dependencies are used for the automatization of releases and API documentation

📥 Installation

By package Manager (PM):

Install-Package NanoXLSX

By .NET CLI:

dotnet add package NanoXLSX

ℹ️ Note: Other methods like adding DLLs or source files directly into your project are technically still possible, but not recommended anymore. Use dependency management, whenever possible

💡 Usage

Quick Start (shortened syntax)

 Workbook workbook = new Workbook("myWorkbook.xlsx", "Sheet1");         // Create new workbook with a worksheet called Sheet1
 workbook.WS.Value("Some Data");                                        // Add cell A1
 workbook.WS.Formula("=A1");                                            // Add formula to cell B1
 workbook.WS.Down();                                                    // Go to row 2
 workbook.WS.Value(DateTime.Now, Style.BasicStyles.Bold);               // Add formatted value to cell A2
 workbook.Save();                                                       // Save the workbook as myWorkbook.xlsx

Quick Start (regular syntax)

 Workbook workbook = new Workbook("myWorkbook.xlsx", "Sheet1");         // Create new workbook with a worksheet called Sheet1
 workbook.CurrentWorksheet.AddNextCell("Some Data");                    // Add cell A1
 workbook.CurrentWorksheet.AddNextCell(42);                             // Add cell B1
 workbook.CurrentWorksheet.GoToNextRow();                               // Go to row 2
 workbook.CurrentWorksheet.AddNextCell(DateTime.Now);                   // Add cell A2
 workbook.Save();                                                       // Save the workbook as myWorkbook.xlsx

Quick Start (read)

 using NanoXLSX.Extensions;

 Workbook wb = WorkbookReader.Load("basic.xlsx");                       // Read the workbook
 System.Console.WriteLine("contains worksheet name: " + wb.CurrentWorksheet.SheetName);
 foreach (KeyValuePair<string, Cell> cell in wb.CurrentWorksheet.Cells)
 {
    System.Console.WriteLine("Cell address: " + cell.Key + ": content:'" + cell.Value.Value + "'");
 }

🔗 Further References

See the full API-Documentation at: https://rabanti-github.github.io/NanoXLSX/.

The Demo Project contains 27 examples covering various use cases. The demo project is maintained in a separate repository. See the section NanoXLSX for the specific examples related to NanoXLSX.

See also: Getting started in the Wiki

Hint: You will find most certainly any function, and the way how to use it, in the Unit Test Project

⚖️ License

NanoXLSX is licensed under the MIT License. See the LICENSE file for more details.

This library claims to be free of any dependencies on proprietary software or libraries. FOSSA Status

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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 (3)

Showing the top 3 NuGet packages that depend on NanoXLSX:

Package Downloads
HighbornBD

Sistema simples de banco de dados pra codigos VB e C#

E3.XLSX

XLSX 文件解析

MaxRunSoftware.Utilities.Data.Excel

Various helper methods and functions for data manipulation such as SQL and CSV files

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 2,940 2/28/2026
3.0.0-rc.9 95 2/15/2026
3.0.0-rc.8 93 2/14/2026
3.0.0-rc.7 122 1/22/2026
3.0.0-rc.6 149 1/7/2026
3.0.0-rc.5 146 1/4/2026
3.0.0-rc.4 340 12/3/2025
3.0.0-rc.3 968 12/2/2025 3.0.0-rc.3 is deprecated because it has critical bugs.
3.0.0-rc.2 488 11/27/2025 3.0.0-rc.2 is deprecated because it is no longer maintained.
3.0.0-rc.1 492 11/25/2025 3.0.0-rc.1 is deprecated because it is no longer maintained.
2.6.7 23,322 10/1/2025
2.6.6 281 9/29/2025
2.6.5 1,832 9/13/2025
2.6.4 10,954 7/18/2025
2.6.3 22,729 4/26/2025
2.6.2 9,093 1/24/2025
2.6.1 1,458 1/19/2025
2.6.0 402 1/12/2025
2.5.2 14,461 11/24/2024
2.5.1 4,392 10/25/2024
Loading failed