IRONSOFTWAREHOME
COMPARE TO OTHER COMPONENTS

A Comparison of IronXL and ClosedXML

Curtis Chau
Curtis Chau
Updated: August 1, 2026

IronXL and ClosedXML are both .NET libraries for reading, manipulating, and writing Excel documents without requiring Microsoft Excel. This comparison covers their APIs and feature scope with working code examples, so you can determine which fits your project's requirements.

What Is IronXL?

IronXL is a .NET library for reading and editing Microsoft Excel documents in C#. IronXL.Excel is a standalone .NET software library for reading a wide range of spreadsheet formats. It does not require Microsoft Excel to be installed, nor does it depend on Interop.

IronXL is an intuitive C# API that allows you to read, edit, and create Excel spreadsheet files in .NET. IronXL fully supports .NET Core, .NET Framework, Xamarin, Mobile, Linux, macOS, and Azure.

IronXL is a widely-used .NET Core and .NET Framework Excel spreadsheet library for C#.

IronXL Feature Set

  • Load, read, and edit data from XLS/XLSX/CSV/TSV
  • Saving and exporting to XLS/XLSX/CSV/TSV/JSON
  • System.Data Objects: Work with Excel Spreadsheets as System.Data.DataSet and System.Data.DataTable objects.
  • Formulas: Work with Excel formulas, recalculated every time a sheet is edited.
  • Ranges: Easy to use WorkSheet ["A1:B10"] syntax. Combine and create ranges intuitively.
  • Sorting: Sort ranges, columns, and rows.
  • Styling: Cell visual styles, font, size, background pattern, border, alignment, and number formats.

More Features of IronXL can be explored using this link.

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 for dealing with the underlying OpenXML Library. The .xlsx is a file extension for an OpenXML underlying API spreadsheet file format used by Microsoft Excel. The .xlsm files support macros. The .xltm are macro-enabled template files. The .xls format is a proprietary binary format, while .xlsx is based on Office OpenXML format.

ClosedXML is a .NET library for report generation in Microsoft Excel without requiring Excel to be installed on the machine that's running the code.

ClosedXML Features

ClosedXML has a user-friendly interface with extensive API functions to handle creation and extraction of content in Excel. With these API calls and pull requests, you can modify every little detail in an Excel sheet or workbook. All the features are listed below:

  1. Formulas
  2. Validation
  3. Hyper-Links
  4. Protection (Sheet and Cell level)
  5. Conditional Formatting
  6. Freeze Panes
  7. Tables
  8. Ranges
  9. Styling
  10. Page Setup (Printing)
  11. Auto-Filters
  12. Comments

The table below provides a side-by-side snapshot of the key differences between IronXL and ClosedXML discussed throughout this article.

FeatureIronXLClosedXML
XLS Format SupportYesNo
XLSX Format SupportYesYes
CSV/TSV Import & ExportYesNo
HTML ExportYesNo
JSON ExportYesNo
Thread SafetyYesNo
Formula EngineFull recalculationPartial formula support
LicensingCommercial (free for development)MIT (free)

IronXL is free for development use; a free 30-day trial unlocks the full feature set for evaluation.

The rest of this article continues as follows:

  1. Create a Console Application
  2. IronXL C# Library Installation
  3. ClosedXML Installation
  4. Create and Save a new Excel Workbook and Sheet
  5. Read Excel File
  6. Working with Excel Formulas
  7. Licensing
  8. Which Library Should You Choose?

1. Create a Console Application

Use the following steps to create a Console Application:

  • Start the Visual Studio 2022 IDE.
  • Click on "Create a new project."
  • On the "Create a new project" page, select C# in the language dropdown list, Windows from the Platforms list, and Console from the Project types list.
  • Select Console App (.NET Framework) from the project templates displayed.
Create a Project

Create a Project

  • Click Next.
  • Name the project "DemoApp" and Click Next.
DemoApp Project

DemoApp Project

  • In the Additional Information screen, specify the Framework version you would like to use. We will use .NET Framework 6.0 in this example.
.NET Framework 6.0

.NET Framework 6.0

  • Click Create to complete the process.

Now, the project is created and we are almost ready to test the libraries. However, we still need to install and integrate them into our project. Let's get started with IronXL first.

2. IronXL C# Library Installation

You can download and install the IronXL library using the following methods:

  1. Using Visual Studio with NuGet packages.
  2. Manually installing the DLL.

Let's take a closer look at each one.

2.1. Using Visual Studio with NuGet Packages

Visual Studio provides the NuGet Package Manager to install NuGet packages in your projects. You can access it through the Project Menu, or by right-clicking your project in the Solution Explorer.

Package Manager

Package Manager

  • Next, from the Browse tab > search for IronXL.Excel > Install
IronXL NuGet Install

IronXL NuGet Install

  • And we are done.

2.2. Manually Installing the DLL

Another way to download and install the IronXL C# Library is to make use of the following steps to install the IronXL NuGet package through the Developer Command Prompt.

  • Open the Developer Command Prompt - usually found in the Visual Studio folder.

Type the following command:

PM > Install-Package IronXL.Excel

  • Press Enter.
  • This will download and install the package.
  • Reload your Visual Studio project and begin using it.

2.3. Add Necessary Using Directives

  1. In Solution Explorer, right-click the Program.cs file and then click View Code.
  2. Add the following using directives to the top of the code file:
using IronXL;

All done! IronXL is downloaded, installed, and ready to use. However, before that, we should install ClosedXML.

3. ClosedXML Installation

To install the ClosedXML package, you can directly download it from NuGet or from NuGet Package Manager/Console in the project.

For directly installing ClosedXML, click on this link.

3.1. Using the NuGet Package Manager/Console

Open the NuGet Package Manager from project solution explorer, browse for ClosedXML, and click install.

ClosedXML NuGet Install

ClosedXML NuGet Install

Or:

  • Open the Developer Command Prompt - usually found in the Visual Studio folder.

Type the following command:

PM > Install-Package ClosedXML

  • Press Enter.
  • This will download and install the package.
  • Reload your Visual Studio project and begin using it.

3.2. Add Necessary Using Directives

  1. In Solution Explorer, right-click the Program.cs file and then click View Code.
  2. Add the following using directives to the top of the code file:
using ClosedXML.Excel;

4. Create and Save a New Excel Workbook and Sheets

A workbook is an Excel file containing multiple worksheets with rows and columns. Both libraries provide the facility to create a new Excel workbook and sheets. Let's have a look at the code step-by-step, and you can find additional IronXL code examples for further reference.

4.1. New Excel Workbook and Sheets using IronXL

Creating a new Excel Workbook using IronXL takes a single line of code. Add the following to your static void main function in the Program.cs file:

// Create a new Excel workbook using IronXL
WorkBook workbook = WorkBook.Create(ExcelFileFormat.XLSX);

Both XLS (older Excel file version) and XLSX (current and newer file version) file formats can be created with IronXL.

And, it's even simpler to create a default Worksheet:

// Create a new worksheet within the workbook
var worksheet = workbook.CreateWorkSheet("IronXL Features");

You can now use the worksheet variable to set cell values and do almost everything an Excel file can do.

// Add data and styles to the new worksheet
worksheet["A1"].Value = "Hello World";
worksheet["A2"].Style.BottomBorder.SetColor("#ff6600");
worksheet["A2"].Style.BottomBorder.Type = IronXL.Styles.BorderType.Double;

Save the Excel file:

// Save the spreadsheet
workbook.SaveAs("NewExcelFile.xlsx");

The output file looks as follows:

NewExcelFile Output

NewExcelFile output

4.2. New Excel Workbook and Sheets using ClosedXML

You can also create excel files (.xlsx, .xlsm) easily using ClosedXML. The following code is a typical example which serves to generate a simple Excel file and save it. You can add a new sample sheet to your workbook and assign values to cells in your Excel application.

// Create a new empty Excel file
var workbook = new XLWorkbook();

// Create a new worksheet and set cell A1 value to 'Hello world!'
var worksheet = workbook.Worksheets.Add("ClosedXML Features");
worksheet.Cell("A1").Value = "Hello world!";

// Save to XLSX file
workbook.SaveAs("Spreadsheet.xlsx");

The output file looks as follows:

Spreadsheet File Output

Spreadsheet File Output

5. Read Excel File (Import Excel File)

Both libraries can open and read existing Excel documents. Let's have a look at the sample code.

5.1. Read Excel Files using IronXL

The IronXL WorkBook class represents an Excel sheet. To open an Excel file using C#, we use WorkBook.Load and specify the path of the file (.xlsx). The following one-line code is used to open the file for reading:

// Load WorkBook
var workbook = WorkBook.Load(@"Spreadsheets\\sample.xlsx");

Each WorkBook can have multiple worksheets in the Excel document. If the workbook contains multiple worksheets, retrieve them by name as follows:

// Open Sheet for reading
var worksheet = workbook.GetWorkSheet("sheetnamegoeshere");

Code for reading the cell values:

// Read from ranges of cells elegantly
foreach (var cell in worksheet["A2:A10"])
{
    Console.WriteLine("Cell {0} has value '{1}'", cell.AddressString, cell.Text);
}

5.2. Read Excel Files using ClosedXML

ClosedXML allows reading of previously created files from your C# application. You can import an excel file using the following code.

// Import Excel file from file's path
var workbook = new XLWorkbook("SimpleTemplate.xlsx");

// Read worksheet from workbook using sheet number
var worksheet1 = workbook.Worksheet(1);

// Read cell value from the first sheet
var data = worksheet1.Cell("A1").GetValue<string>();

// Display on screen
Console.WriteLine(data);

6. Working with Excel Formulas

Excel formulas are one of the most important features of working with Excel. Both libraries have a powerful formula calculation engine. They provide the facility to work with formulas and easily apply them to cells.

6.1. Working with Excel Formulas using IronXL

After loading the workbook and worksheet, the following code sample can be used to either make changes to formulas, or be applied to specific cells. The code is as follows:

// Set formulas
worksheet["A1"].Formula = "=Sum(B8:C12)";
worksheet["B8"].Formula = "=C9/C11";
worksheet["G30"].Formula = "=Max(C3:C7)";

// Force recalculating all formula values in all sheets
workbook.EvaluateAll();

You can also retrieve formulas and their values:

// Get the formula's calculated value e.g. "52"
string formulaValue = worksheet["G30"].Value;

// Get the formula as a string e.g. "Max(C3:C7)"
string formulaString = worksheet["G30"].Formula;

// Save your changes with updated formulas and calculated values
workbook.Save();

6.2. Working with Excel Formulas using ClosedXML

ClosedXML's formula engine covers many common functions, though not every Excel formula is within its current scope. If a formula is unsupported or contains an error, the library will throw an exception. It is worth testing your formulas before deploying to production. Let's have a look at how to use them.

// Set formulas
worksheet.Cell("A1").Value = "Hello World!";
worksheet.Cell("A2").FormulaA1 = "=MID(A1, 7, 5)";

// You can use Evaluate function to directly calculate formula
var sum = worksheet.Evaluate("SUM(B1:B7)");

// Force recalculation
worksheet.RecalculateAllFormulas();

// Save Excel file
workbook.SaveAs("Formula Calculation.xlsx");

The property FormulaA1 is with reference to A1 cell. If you are referencing another cell, you must add it to the Formula property. E.g., FormulaC2.

7. Licensing

IronXL is an openly commercial C# Excel library. It is free for development and can always be licensed for commercial deployment. Licenses are available for single-project use, single developers, agencies, and global corporations as well as SaaS and OEM redistribution. All licenses include a 30-day money-back guarantee, one year of product support and updates, validity for dev/staging/production, and also a permanent license (one-time purchase). The lite package starts from $999.

IronXL License Packages

IronXL License Packages

For ClosedXML, applications using this DLL file do not require a separate license either for single-use or commercial use. In order for any solution to work with ClosedXML, just install the publicly available NuGet package "ClosedXML". ClosedXML is licensed under the MIT License. MIT License is a short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code.

ClosedXML License

ClosedXML License

Beyond license cost, total project cost includes the developer hours spent on building format-conversion pipelines, managing thread-safety wrappers for concurrent workloads, and sourcing additional libraries for features outside ClosedXML's scope (such as CSV or HTML export). For teams evaluating cost over a multi-year project lifecycle, these integration and maintenance hours frequently eclipse the difference between open-source and commercial licensing.

8. Which Library Should You Choose?

Summary

IronXL is a comprehensive library for manipulating Excel files. IronXL allows developers to read, generate, and edit Excel (and other Spreadsheet files) in .NET applications and websites. It ships as a single NuGet package with built-in support for XLS, XLSX, CSV, TSV, HTML, and JSON - covering format conversion, formulas, styling, and System.Data integration without additional dependencies.

ClosedXML is a .NET library for reading and writing Excel files, which makes it easier for developers to create Excel 2007+ files. It provides a clean, object-oriented way to manipulate the files (similar to VBA) without dealing with the hassles of XML Documents. It can be used by any .NET language like C# and Visual Basic (VB). It provides many features of OpenXML, though some capabilities - such as Macros, Embedding, and Charts - are outside its current scope.

Conclusion

IronXL is also helpful in other Excel operations like cell data formats, sorting, cell styling. It can also work with Excel Spreadsheets as System.Data.DataSet and System.Data.DataTable. It supports console, web server, and desktop-based applications. It is also supported on all OS platforms.

ClosedXML is a lightweight library for reading, manipulating, and writing Excel files using the OpenXML API, and it is straightforward to implement. It handles many common Excel operations well - Page Setup, Freeze Panes, Hyperlinks, Tables, and Conditional Formatting among them - and carries minimal performance overhead.

Both IronXL and ClosedXML handle Excel spreadsheet operations reliably and neither requires a Microsoft Office installation. Where the two libraries diverge is in architectural scope: IronXL provides built-in thread safety - an important consideration for server-side or parallel workloads - while ClosedXML is not designed for concurrent access. IronXL also supports format interconversion (XLSX to and from CSV, HTML, and JSON), a capability that falls outside ClosedXML's focused feature set. For teams whose workflows involve importing or exporting across multiple file formats, this broader format coverage reduces the need for additional third-party tooling.

Now you can get five Iron products for the price of just two in the lite package for 1 developer($2,998) and unlimited for $unlimitedSuitePrice and save up to 60%.

Ready to see how IronXL fits your project? Download the free 30-day trial to explore every feature covered in this comparison.

Please note: ClosedXML is a registered trademark of its respective owner. This site is not affiliated with, endorsed by, or sponsored by ClosedXML. All product names, logos, and brands are property of their respective owners. Comparisons are for informational purposes only and reflect publicly available information at the time of writing.
Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Related Articles

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required