A Comparison between IronXL and Spire XLS
Microsoft Excel is a component of Microsoft Office that deals specifically with spreadsheets, aiming to help organize numbers and data using formulas and functions.
Have you ever wondered how .NET developers deal with Excel files? This article will discuss how developers handle Excel files and which tools are best suited for saving, reading, and editing data in Excel documents. .NET developers can find converting Excel files and editing existing documents challenging. Today, we will compare two popular .NET libraries that deal with Excel documents: Spire XLS and IronXL.
2. Spire XLS
Spire.XLS for .NET is a professional Excel .NET API that can be used in any .NET (C#, VB .NET, ASP.NET, .NET Core, .NET 5.0, MonoAndroid, and Xamarin.iOS) application to create, read, write, convert, and print Excel files. It is an object model Excel API that allows you to generate new Excel documents from templates, edit existing ones, and convert Excel files on the .NET platform.
This library is a managed Excel .NET assembly requiring no Microsoft Excel. It supports both classic Excel 97-2003 format (.xls) and modern Excel (.xlsx, .xlsb, .xlsm) formats. It is quick and reliable compared to designing your spreadsheet manipulation solution or using Microsoft Automation.
Excel encryption/decryption, cell hide/unhide, and worksheet lock/unlock are some of the security features available in the Spire.XLS class library.
2.1. Spire.XLS Features
2.1.1. Platforms
Spire.XLS for .NET allows developers to create ASP.NET, Web Services, WinForms, and other types of applications for any .NET Framework version from 2.0 to 4.5, .NET 5.0, .NET Core, .NET Standard, MonoAndroid, Xamarin, and iOS. It supports both 32-bit and 64-bit systems.
2.1.2. File Conversion
Spire.XLS enables users to convert Excel files to different formats and convert files in different forms to Excel files:
- Excel to Text
- Excel to Image
- Excel to PDF file
- Excel to HTML
- XML/CSV to Excel file
- Excel to XPS
- Excel to SVG
2.1.3. Contents and Features
Spire.XLS for .NET comes with many features to edit and manipulate Excel files, most notably:
- Creating and editing Excel workbooks.
- Saving Excel files to file streams.
- Finding and replacing data in Excel workbooks.
- Sorting and validating data.
- Printing files.
- Deleting, inserting, or hiding rows and columns.
2.1.4. Formatting Features
Spire.XLS for .NET provides complete programmatic access to all spreadsheet components and formatting attributes, such as font settings, number format settings, text alignment, graphic objects, and formatting worksheets, rows, columns, or a range of Excel cells.
2.1.5. Page Setup
Developers can configure Page Setup parameters using Spire.XLS for .NET:
- Set the print area and print titles, or enable gridlines.
- Add page breaks.
- Create or update image-based headers and/or footers.
- Change page direction, scale, and paper size.
- Set page centering and margins.
3. IronXL
IronXL is a .NET library that allows developers to deal with Excel and other spreadsheet files in C# efficiently. Office Interop isn't required, and there is no particular need to install Microsoft Office on Core or Azure.
Iron Software's IronXL package reads and writes Excel (XLS, XLSX, and CSV) files in C# and other .NET languages. It supports .NET Core 2, Framework 4.5, Azure, Mono, Mobile, and Xamarin.
IronXL allows us to create and export XLSX, XLS, CSV, TSV, JSON, and XML documents. We can also export to System.Data.DataSet and System.Data.DataTable objects for SQL interoperability.
3.1. IronXL Features
3.1.1. Load, Read, and Edit Data
IronXL allows users to manipulate Excel files to load, read, and edit data from XLS/XLSX/CSV/TSV.
3.1.2. Saving and Exporting
IronXL allows users to save and export Excel files to XLS/XLSX/CSV/TSV/JSON formats.
3.1.3. System.Data Objects
IronXL works with Excel spreadsheets as System.Data.DataSet and System.Data.DataTable objects.
3.1.4. Formulas
IronXL works with Excel formulas, which are recalculated each time a sheet is edited.
3.1.5. Ranges
Easy to use WorkSheet syntax for ranges like ["A1:B10"]. Combine and create ranges intuitively.
3.1.6. Sorting
Sort ranges, columns, and rows.
3.1.7. Styling
Excel cell visual styles include font, size, background pattern, border, alignment, and number formats.
4. Creating a New Project in Visual Studio
Open Visual Studio and go to the File menu. Select "New Project", then choose a console application.
Enter the project name and select the desired path. Then, click the create button. Select the required .NET framework, as shown below:

The Visual Studio project will now generate the structure for the chosen application. If a console, Windows, or web application is selected, it will open the Program.cs file where code can be entered to build and run the application.

Now, we can add the library and test the program.
5. Install the IronXL Library
The IronXL library can be downloaded and installed in four different ways:
- Using the Visual Studio NuGet Package Manager
- Using the Visual Studio Command-Line
- Direct Download from the NuGet Webpage
- Direct Download from the IronXL webpage
5.1 Using the Visual Studio NuGet Package Manager
Visual Studio provides the NuGet Package Manager option to install packages directly to the solution. Here is how you can open the NuGet Package Manager:

Search for "IronXL" in the package manager to find and install the desired package:

Select IronXL and install the package to your solution.
5.2 Using the Visual Studio Command-Line
- In Visual Studio, go to Tools -> NuGet Package Manager -> Package Manager Console.
Run the following command in the package manager console:
Install-Package IronXL.Excel
The package will now download to the current project and be ready for use.

5.3 Direct Download from the NuGet Webpage
To download the NuGet package directly:
- Navigate to https://www.nuget.org/packages/IronXL.Excel.
- Select "Download Package" from the menu on the right.
- Double-click the downloaded package to install it automatically.
- Reload the solution and start using it in the project.
5.4 Direct Download from the IronXL Webpage
Download the latest package from IronXL's webpage here. After downloading:
- Right-click on the project in the Solution Explorer.
- Select "Add Reference" and browse to the downloaded reference location.
- Click OK to add the reference.
6. Install the Spire.XLS
Spire.XLS offers near-identical methods for API integration:
- Using the Visual Studio NuGet Package Manager
- Using the Visual Studio NuGet Package Console
- Direct Download from the Spire.XLS Website
- Direct Download from the NuGet Website
6.1. Using the Visual Studio NuGet Package Manager
Following the process for IronXL, open the NuGet Package Manager and search for Spire.XLS:

Select the required package and install it.
6.2. Using the Visual Studio NuGet Package Console
- In Visual Studio, go to Tools -> NuGet Package Manager -> Package Manager Console.
Run the following line in the console:
Install-Package Spire.XLS -Version 12.3.8Install-Package Spire.XLS -Version 12.3.8SHELL
The package will be downloaded and installed in the current project.

6.3. Direct Download from the NuGet Website
To download Spire.XLS directly:
- Navigate to https://www.nuget.org/packages/Spire.XLS/.
- Select "Download Package" from the right-hand menu.
- Double-click the downloaded package to install it automatically.
- Reload the solution and start using it in the project.
7. Create New Excel Files
Both .NET class libraries allow creating new Excel documents easily.
7.1. Create New Excel Files Using IronXL
IronXL allows creating Excel sheets in XLS and XLSX formats. The code to create a new workbook using IronXL is as follows:
using IronXL;
class Program
{
static void Main()
{
// Create a new workbook in XLS format
WorkBook xlsWorkbook = WorkBook.Create(ExcelFileFormat.XLS);
xlsWorkbook.Metadata.Author = "IronXL";
// Add a blank WorkSheet
WorkSheet xlsSheet = xlsWorkbook.CreateWorkSheet("new_sheet");
// Add data and styles to the new worksheet
xlsSheet["A1"].Value = "Hello World";
xlsSheet["A2"].Style.BottomBorder.SetColor("#ff6600");
xlsSheet["A2"].Style.BottomBorder.Type = IronXL.Styles.BorderType.Double;
// Save the Excel file
xlsWorkbook.SaveAs("NewExcelFile.xls");
}
}using IronXL;
class Program
{
static void Main()
{
// Create a new workbook in XLS format
WorkBook xlsWorkbook = WorkBook.Create(ExcelFileFormat.XLS);
xlsWorkbook.Metadata.Author = "IronXL";
// Add a blank WorkSheet
WorkSheet xlsSheet = xlsWorkbook.CreateWorkSheet("new_sheet");
// Add data and styles to the new worksheet
xlsSheet["A1"].Value = "Hello World";
xlsSheet["A2"].Style.BottomBorder.SetColor("#ff6600");
xlsSheet["A2"].Style.BottomBorder.Type = IronXL.Styles.BorderType.Double;
// Save the Excel file
xlsWorkbook.SaveAs("NewExcelFile.xls");
}
}7.2. Create a New Excel File Using Spire.XLS
Spire.XLS allows creating Excel files without installing MS Excel or any third-party library. Below is the sample code:
using Spire.Xls;
using System.IO;
namespace CreateExcelFiles
{
class Program
{
static void Main(string[] args)
{
// Instantiate Workbook
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];
// Set text in a specific cell
sheet.Range["C10"].Text = "The sample demonstrates how to save an Excel workbook to a stream.";
// Save the workbook to a stream
FileStream fileStream = new FileStream("DEMO.xls", FileMode.Create);
workbook.SaveToStream(fileStream);
fileStream.Close();
// Automatically open the new Excel file
System.Diagnostics.Process.Start("DEMO.xls");
}
}
}using Spire.Xls;
using System.IO;
namespace CreateExcelFiles
{
class Program
{
static void Main(string[] args)
{
// Instantiate Workbook
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];
// Set text in a specific cell
sheet.Range["C10"].Text = "The sample demonstrates how to save an Excel workbook to a stream.";
// Save the workbook to a stream
FileStream fileStream = new FileStream("DEMO.xls", FileMode.Create);
workbook.SaveToStream(fileStream);
fileStream.Close();
// Automatically open the new Excel file
System.Diagnostics.Process.Start("DEMO.xls");
}
}
}8. CSV to Excel
Converting CSV to Excel is a popular format conversion. Both IronXL and Spire.XLS provide this feature.
8.1. CSV to Excel using IronXL
IronXL enables developers to generate Excel workbooks from CSV format effortlessly. Here is how to convert a CSV file to Excel:
using IronXL;
class Program
{
static void Main()
{
// Load CSV file into a workbook
WorkBook workbook = WorkBook.LoadCSV("test.csv", fileFormat: ExcelFileFormat.XLSX, ListDelimiter: ",");
WorkSheet ws = workbook.DefaultWorkSheet;
// Save the workbook as an Excel file
workbook.SaveAs("CsvToExcelConversion.xlsx");
}
}using IronXL;
class Program
{
static void Main()
{
// Load CSV file into a workbook
WorkBook workbook = WorkBook.LoadCSV("test.csv", fileFormat: ExcelFileFormat.XLSX, ListDelimiter: ",");
WorkSheet ws = workbook.DefaultWorkSheet;
// Save the workbook as an Excel file
workbook.SaveAs("CsvToExcelConversion.xlsx");
}
}8.2. CSV to Excel using Spire.XLS
Spire.XLS handles CSV to Excel conversion efficiently. Here's how you can achieve this:
using Spire.Xls;
namespace ConvertCsvToExcel
{
class Program
{
static void Main(string[] args)
{
// Create an instance of Workbook class
Workbook workbook = new Workbook();
// Load a CSV file
workbook.LoadFromFile(@"ExcelToCSV.csv", ",", 1, 1);
// Get the first worksheet and used range
Worksheet sheet = workbook.Worksheets[0];
CellRange usedRange = sheet.AllocatedRange;
usedRange.IgnoreErrorOptions = IgnoreErrorType.NumberAsText;
// Autofit columns and rows
usedRange.AutoFitColumns();
usedRange.AutoFitRows();
// Save the result file
workbook.SaveToFile("CSVToExcel.xlsx", ExcelVersion.Version2013);
}
}
}using Spire.Xls;
namespace ConvertCsvToExcel
{
class Program
{
static void Main(string[] args)
{
// Create an instance of Workbook class
Workbook workbook = new Workbook();
// Load a CSV file
workbook.LoadFromFile(@"ExcelToCSV.csv", ",", 1, 1);
// Get the first worksheet and used range
Worksheet sheet = workbook.Worksheets[0];
CellRange usedRange = sheet.AllocatedRange;
usedRange.IgnoreErrorOptions = IgnoreErrorType.NumberAsText;
// Autofit columns and rows
usedRange.AutoFitColumns();
usedRange.AutoFitRows();
// Save the result file
workbook.SaveToFile("CSVToExcel.xlsx", ExcelVersion.Version2013);
}
}
}9. Licensing
IronXL Licensing
IronXL provides a developer's license for free, with the Lite bundle starting at a price with no hidden fees. SaaS and OEM distribution are possible. All licenses offer a 30-day money-back guarantee, a year of software support and upgrades, and a perpetual license. For more details on IronXL pricing and licensing, visit their official licensing page.
Spire.XLS Licensing
Spire.XLS offers three licensing categories:
- Free Version: Limited to five sheets per workbook and 200 rows per sheet. The print function is not available.
- Standard Edition: Limited to .NET, without printing or conversion support.
- Pro Edition: Part of the Spire.XLS Pack, supports numerous conversions like Excel to PDF, HTML, CSV, etc.
Conclusion
IronXL for .NET assists developers in converting Excel to various formats, offering reading and writing of Excel in C# and other .NET languages. It supports .NET Core 2, Framework 4.5, Azure, Mono, Mobile, and Xamarin. IronXL is integrated with tools like IronOCR, IronPDF, IronBarcode, and IronWebScraper.
Spire.XLS also provides capabilities to create, edit, and convert Excel documents, supporting both classic and modern Excel formats.
In comparison, IronXL offers more features and a competitive price structure. For more information, visit the IronXL website, and for downloads, visit this NuGet link.
Frequently Asked Questions
How can I convert HTML to PDF in C#?
You can use IronPDF's RenderHtmlAsPdf method to convert HTML strings into PDFs. You can also convert HTML files into PDFs using RenderHtmlFileAsPdf.
What are the main features of IronXL?
IronXL supports reading and writing Excel (XLS, XLSX, CSV) files efficiently without requiring Office Interop or Microsoft Office installation. It offers robust data manipulation, export capabilities, and formula management.
How do I install IronXL for handling Excel files in C#?
IronXL can be installed using the Visual Studio NuGet Package Manager, the Visual Studio Command-Line, or by direct download from the NuGet or IronXL websites.
How do I convert a CSV file to Excel using IronXL?
You can convert a CSV file to Excel by loading the CSV into a WorkBook using IronXL and then saving it in the desired Excel format.
What are the licensing options for IronXL?
IronXL offers a developer's license for free, with additional licensing options available for SaaS and OEM distribution. All licenses include a 30-day money-back guarantee and a year of software support and upgrades.
How do I create an Excel file using IronXL?
To create an Excel file using IronXL, use the WorkBook class to create a workbook in XLS or XLSX format, add worksheets, insert data, apply styles, and save the file to a desired location.
How does IronXL compare to Spire.XLS?
Both libraries provide capabilities to create, edit, and convert Excel documents. IronXL offers more features, including integration with additional tools, while Spire.XLS supports both classic and modern Excel formats. IronXL is noted for its competitive pricing structure and extensive Excel file manipulation and conversion capabilities.
What is Spire.XLS for .NET?
Spire.XLS for .NET is a professional Excel API that allows developers to create, read, write, convert, and print Excel files in various .NET applications, supporting multiple frameworks and formats.
What Excel formats are supported by Spire.XLS?
Spire.XLS supports multiple Excel formats such as .xls, .xlsx, .xlsb, and .xlsm, allowing comprehensive Excel file creation, editing, and conversion without needing Microsoft Excel.
Can IronXL work without Microsoft Office installed?
Yes, IronXL can read and write Excel files efficiently without requiring Office Interop or Microsoft Office installation.








