ClosedXML /ClosedXML
ClosedXML is a .NET library for reading, manipulating and writing Excel 2007+ (.xlsx, .xlsm) files. It aims to provide an intuitive and user-friendly interface to dealing with the underlying OpenXML API.
★ 5,755⑂ 937👁 144⑃ 1,230● 1,546▤ 46
-1
Daily
5,755
stars
937
forks
144
watchers
1,230
prs
1,546
issues
46
releases
README
!ClosedXML
💾 Download unstable CI build
ClosedXML is a .NET library for reading, manipulating and writing Excel 2007+ (.xlsx, .xlsm) files. It aims to provide an intuitive and user-friendly interface to dealing with the underlying OpenXML API.
For more information see the documentation or the wiki.
Release notes & migration guide
The public API is still not stable and it is a very good idea to read release notes and migration guide before each update.
Release notes for 0.100
Migration guide for 0.100
Release notes for 0.97
Performance
Performance matters mostly for large files. For small files, few ms here or there doesn't matter. The presented data are from generally develop branch (currently 0.103-beta).
Runtime details
BenchmarkDotNet v0.13.8, Windows 11 (10.0.22621.2283/22H2/2022Update/SunValley2)
AMD Ryzen 5 5500U with Radeon Graphics, 1 CPU, 12 logical and 6 physical cores
.NET SDK 8.0.100-rc.1.23463.5
[Host] : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2
Save
| Description | Rows | Columns | Time/Memory to insert data | Save workbook | Total time/memory |
|------------------------------|-----------|------------------------|----------------------------|------------------------------|---|
| Mixed (text/number) workbook.Gist | 250 000 | 15 | 1.619 sec / 117 MiB | 6.343 sec | 7.962 sec / 477 MiB |
| Text only workbook. Gist | 1 000 000 | 10 | 6.302 sec / 402 MiB | 17.134 sec | 23.436 sec / 1880 MiB |
Load
| Description | Rows | Columns | Time to load data | Used memory |
|--------------------------------------------------------------------|-----------|---------|-------------------|-------------|
| Load mixed workbook (10 text/5 number columns). | 250 000 | 15 | 15.648 sec | 236 MiB |
| Text only workbook. | 1 000 000 | 10 | 49.046 sec | 801 MiB |
Load tests used files created during save test.
Frequent answers
- If you get an exception Unable to find font font name or fallback font fallback font name. Install missing fonts or specify a different fallback font through ‘LoadOptions.DefaultGraphicEngine = new DefaultGraphicEngine(“Fallback font name”)’, see help page about missing fonts.
- ClosedXML is not thread-safe. There is no guarantee that parallel operations will work. The underlying OpenXML library is also not thread-safe.
- If you get an exception The type initializer for 'Gdip' threw an exception. on Linux, you have to upgrade to 0.97+.
Install ClosedXML via NuGet
If you want to include ClosedXML in your project, you can install it directly from NuGet
To install ClosedXML, run the following command in the Package Manager Console
PM Install-Package ClosedXML
What can you do with this?
ClosedXML allows you to create Excel files without the Excel application. The typical example is creating Excel rTop issues
#469Printed document does not respect actual font and font size37 comments · 2017-09-07#934IXLRows.AdjustToContents() ignores text wrapping33 comments · 2018-06-29#1636Memory Leak22 comments · 2021-03-04#388Insert Image in Export Excel on PageSetup Property using Closed XML17 comments · 2017-07-11#1243AdjustToContents() on Columns not working15 comments · 2019-07-05#510Set picture dimensions in non-dpi-dependant units15 comments · 2017-09-25#781Large memorystream loading into Workbook14 comments · 2018-04-15#297Small columns are not as small as they should be14 comments · 2017-05-04
Discussions
#2892Why is SixLabors.Fonts restricted to [1.0.0, 3.0.0) in Closed XML 0.105.13 comments · 2026-10-14#2886How do I work with the exception PartStructureException?1 comments · 2026-09-18#2880Preferred channel for reporting a security issue?1 comments · 2026-09-02#2879We're building on ClosedXML — upstream fixes coming, plus a small offer0 comments · 2026-08-26#2869Expected release date for version 0.106.01 comments · 2026-07-10#2865How to use formatted Dates/DateTime in header of a DataTable?1 comments · 2026-06-23#2841Need a hint for TopLeftCellAddress combined with Freeze1 comments · 2026-04-16#2840help for convert backgroud-rule from excel to closedXML1 comments · 2026-04-15
Latest release
0.105.1 0.105.1 2026-07-25fix: bound SixLabors.Fonts to version range [1.0.0,3.0.0) by @igitur in 2870 Full Changelog: https://github.com/ClosedXML/ClosedXML/compare/0.105.0...0.105.1