Convert XLSX to JSON in C#

JSON is a popular format to exchange data within or between the applications. The lightweight JSON files make it possible for you to store and process small or large sized data easily. On the other hand, Excel XLSX files are commonly used to keep and share the data. However, in certain cases, you may need to convert XLSX data to JSON format from within .NET applications. To achieve that, this article covers how to convert XLSX to JSON programmatically in C#.

Easy Steps to Convert XLSX to JSON in C#

To convert the XLSX files to JSON format in C#, we will use Aspose.Cells for .NET. The library hides the complex conversion operations and lets you convert XLSX files to JSON format within a couple of steps. The following simple steps would be required to convert an XLSX file to JSON.

  • Load the XLSX file from disk.
  • Save it in JSON format to desired location.

The following section demonstrates how to download or install Aspose.Cells for .NET.

C# XLSX to JSON Export Library – Free Download

Aspose.Cells for .NET is a high-speed and powerful library to create and process Excel files seamlessly. In addition, it provides a high fidelity converter for back and forth conversion of XLSX files. You can download it’s DLL from the downloads section or install it from NuGet.

PM> Install-Package Aspose.Cells

Convert XLSX to JSON in C#

In XLSX to JSON conversion, Aspose.Cells for .NET converts each row of the worksheet into an object of JSON. The following are the steps to convert an XLSX file to JSON in C#.

  • Load the XLSX file using Workbook class by specifying its path.
  • Save XLSX file into JSON format using Workbook.Save method.

The following code sample shows how to perform XLSX to JSON export in C#.

C# Library for XLSX to JSON Export - Get a Free License

You can get a free temporary license to use all the features of Aspose.Cells for .NET without any limitations.


In this article, you have learned how to convert XLSX files to JSON format programmatically in C#. You can simply install Aspose.Cells for .NET into your applications and perform XLSX to JSON export in C# within a couple of steps. Furthermore, you may go through the documentation of Aspose.Cells for .NET to explore other features. In case you would have any queries, please feel free to contact us at the forum.

See Also