How to Convert Excel (XLSX) to a JSON Object Array with Java

2 min readJul 6, 2022


Many of us are familiar with XLSX file extensions from working extensively in Excel. As ubiquitous as that format may be, it leaves much to be desired when it comes to interoperability with other platforms and systems. Thankfully, JSON is one of the most interoperable formats out there, and with our XLSX to JSON conversion API, you can make that transition in an instant whenever the need arises. Below, we’ll walk through how you can take advantage of this API & structure your API call in Java.

We will start by installing the Java SDK with Maven. First, include a reference in the pom.xml repository:


Then add one to the pom.xml dependency:


Next add the import classes to the top of your file, and call the API:

// Import classes:
//import com.cloudmersive.client.invoker.ApiClient;
//import com.cloudmersive.client.invoker.ApiException;
//import com.cloudmersive.client.invoker.Configuration;
//import com.cloudmersive.client.invoker.auth.*;
//import com.cloudmersive.client.ConvertDataApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();// Configure API key authorization: Apikey
ApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey");
Apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
ConvertDataApi apiInstance = new ConvertDataApi();
File inputFile = new File("/path/to/inputfile"); // File | Input file to perform the operation on.
try {
byte[] result = apiInstance.convertDataXlsxToJson(inputFile);
} catch (ApiException e) {
System.err.println("Exception when calling ConvertDataApi#convertDataXlsxToJson");

Nice and easy, right? Make sure you have the following parameters satisfied, and you’re good to go (no further code required):

  1. Your input file to perform the operation on
  2. Your Cloudmersive API key (this can be obtained by registering a free account on our website,




There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.