FreeDotnetPOI is a community-maintained fork of NPOI at version 2.7.6 (commit a0f50a01a), the last release published under the Apache License 2.0. NPOI 2.8.0 and later are released under a different license; this fork continues the Apache-2.0 2.7.x line, keeping dependencies current and fixing security vulnerabilities.
Like NPOI, it is the .NET version of the Apache POI project: it reads and writes xls (Excel 97-2003), xlsx (Excel 2007+) and docx (Word 2007+) files.
dotnet add package FreeDotnetPOI
FreeDotnetPOI is a drop-in replacement for the NPOI 2.7.x package. Assembly names, namespaces (NPOI.*) and the strong-name key are unchanged, so no code changes are needed.
- Replace the
NPOIpackage reference withFreeDotnetPOI. Don't reference both packages in the same project. - If your project references
SixLabors.ImageSharpdirectly, replace it with FreeDotnetImageSharp. It provides the sameSixLabors.ImageSharpassembly. - If your project references
SixLabors.Fontsdirectly, replace it with FreeDotnetFonts. It provides the sameSixLabors.Fontsassembly. - If your code drives
XSSFSheetXMLHandlerorReadOnlySharedStringsTablewith NSax types itself, replaceusing NSAX;andusing NSAX.Helpers;withusing NPOI.XSSF.EventUserModel.Sax;, replace theSAXDriversetup withSaxParser.Parse(stream, handler), and catchSystem.Xml.XmlExceptioninstead ofSAXException. Code that usesXSSFReader, the extractors orXSSFWorkbookneeds no change.
.NET 8 and later, .NET Standard 2.1, .NET Standard 2.0 and .NET Framework 4.7.2 and later (package targets net10.0, net8.0, netstandard2.1, netstandard2.0, net472). .NET 10 apps get a build compiled for .NET 10; .NET 9 apps use the net8.0 build.
- Image handling uses FreeDotnetImageSharp 2.1.15 instead of
SixLabors.ImageSharp2.1.11. It is an Apache-2.0 fork of ImageSharp 2.1.13 that fixes GHSA-j9gm-c75j-xc9q, GHSA-jjfr-hcj7-qf5w, GHSA-j3p4-wp97-rph4, GHSA-gwg2-r3hj-4w44 and GHSA-wmxv-xphr-5c9g, and hardens ICC profile parsing. - Text measurement uses FreeDotnetFonts 1.0.2 instead of
SixLabors.Fonts1.0.1 (the same code under Apache-2.0). FreeDotnetPOI does not depend on any Six Labors package. System.Security.Cryptography.Xmlis updated to 8.0.5 andSystem.Formats.Asn1to 8.0.2 (security fixes).- The streaming XSSF reader (
XSSFReader,XSSFSheetXMLHandler,ReadOnlySharedStringsTable,XSSFEventBasedExcelExtractor) uses its ownXmlReader-based SAX layer inNPOI.XSSF.EventUserModel.Saxinstead of the LGPL-3.0NSaxpackage. It never resolves external entities or expands DTD entities. All FreeDotnetPOI dependencies are under the MIT or Apache-2.0 license. - Fixed data loss when opening an OOXML file (
.xlsx,.docx) that can't be opened as a zip file right away (for example, briefly locked by another process): the fallback path truncated the file to 0 bytes instead of reading it. TempFile.GetTempFilePathuses GUID-based names, so processes creating temp files at the same moment no longer get the same path.
| Version | Change |
|---|---|
| 2.7.11 | Security: System.Security.Cryptography.Xml 8.0.5 (CVE-2026-96222, CVE-2026-96958, CVE-2026-96959, CVE-2026-96960). Adds a net10.0 build. Removed the LGPL-3.0 NSax dependency; code that uses NSax types with the SAX handlers directly needs a small change (see Switching from NPOI 2.7.x). |
| 2.7.10 | FreeDotnetImageSharp 2.1.15: hardens ICC profile parsing against untrusted counts (gigabyte-sized allocations from a small malformed profile when reading IccProfile.Entries). NPOI itself does not read ICC profiles. |
| 2.7.9 | FreeDotnetFonts 1.0.2 replaces SixLabors.Fonts 1.0.1. |
| 2.7.8 | OOXML open data-loss fix; GUID-based temp file names. |
| 2.7.7 | First release: FreeDotnetImageSharp 2.1.14 replaces SixLabors.ImageSharp 2.1.11; System.Security.Cryptography.Xml 8.0.4. |
Details for each version are in the GitHub releases. Report bugs and security issues in GitHub issues.
This project is not affiliated with or endorsed by Nissl Lab or The Apache Software Foundation. All credit for the original work goes to Tony Qu and the NPOI contributors. See NOTICE.
The original NPOI README follows. Its system requirements describe upstream NPOI; for this package see Supported frameworks.
NPOI code examples (This example repo is private. You can get access by sponsoring me)
a. It's totally free to use
b. Cover most features of Excel (cell style, data format, formula and so on)
c. Supported formats: xls, xlsx, docx.
d. Designed to be interface-oriented (take a look at NPOI.SS namespace)
e. Support not only export but also import
f. Real successful cases all over the world
g. Works on both Windows and Linux
.NET 8
.NET Standard 2.1 (.NET Core 3.x, .NET 5, .NET 6)
.NET Standard 2.0 (.NET Core 2.x)
.NET Framework 4.0 and above