MOBI to EPUB – Convert MOBI to EPUB in C#


A MOBI file is a Mobipocket eBook file. They’re used for storing digital books and are designed specifically for mobile devices with low bandwidth. MOBI files support things like bookmarking, JavaScript, frames, and adding notes and corrections. Whereas, that EPUB is widely supported across all platforms whilst MOBI is predominantly a Kindle format. Furthermore, the most significant advantage is that such ebooks are created in a format that changes shape according to the device you read it on. It doesn’t matter if somebody is reading your book from a tablet or a phone; it will always be displayed correctly. In this article, we are going to discuss the steps on how to convert a MOBI file to EPUB format using .NET REST API.

Word processing REST API

Aspose.Words Cloud API is developed to facilitate our customers to open, create, edit, merge, split, compare and convert a Word document in the Cloud. No MS Office automation or other application required. All the Word and OpenOffice formats processing within Cloud. Furthermore, the API is robust enough to handle eBook formats including MOBI and EPUB. In order to further facilitate our users, we have created specific programming language SDKs utilizing the corresponding document-processing functionality as per language standards. Furthermore, these SDKs are lightweight and can greatly simplify the developer’s interaction with REST/HTTP.

We are going to use Aspose.Words Cloud SDK for .NET for the conversion purposes.


In order to get started with the SDK, the first step is to perform the installation. It is available for download at NuGet and GitHub. So please execute the following command in the terminal to install the SDK via NuGet:

nuget install Aspose.Words-Cloud

In case you need to install from NuGet Package Manager, please execute the following command:

PM> Install-Package Aspose.Words-Cloud

Visual Studio approach

Another approach is the installation directly within Visual Studio:

  1. Open the Solution Explorer.
  2. Expand the project and Right-click Packages folder within your solution.
  3. Select Manage NuGet Packages… option
  4. Click on the Browse tab and search for “Aspose.Words-Cloud“.
  5. Click the checkbox besides Aspose.Words-Cloud package, select the appropriate version in the right-tab and click Add Package button.
Image 1:- Aspose.Words-Cloud as NuGet package.
Aspose.Words-Cloud package in project
Image 2:- Aspose.Words-Cloud Package in Visual Studio project.

Cloud subscription

Our APIs are only accessible to authorized persons so that data integrity and privacy are maintained. Therefore, the first step is to create a free subscription account by visiting Aspose.Cloud dashboard. If you have GitHub or Google account, simply Sign Up. Otherwise, click on the Create a new Account button and provide the required information. Now login to the dashboard using credentials and expand the Applications section from the dashboard and scroll down towards the Client Credentials section to see Client ID and Client Secret details.

Client Credentials
Image 3:- Client Credentials at Aspose.Cloud dashboard.

Convert MOBI to EPUB in C#

Please visit the following details to perform MOBI format conversion to EPUB using C# .NET code snippet.

  • Create Configuration object while providing Client ID and Client Secret details
  • Seconldy, create an instance of WordsApi class which takes Configuration object as an argument
  • Thirdly, initialize an object of UploadFileRequest class which takes input MOBI file stream instance as argument
  • Now upload the input file to Cloud storage using UploadFile(..) method of WordsApi
  • The next step is to create an object of GetDocumentWithFormatRequest while providing input file, resultant format and resultant file names are arguments
  • Finally, call the GetDocumentWithFormat(..) method to perform the conversion operation. The output file is saved in Cloud storage
resultant EPUB preview
Image 4:- Preview of resultant EPUB file.

The sample files used in above example can be downloaded from and converted.epub.

MOBI to EPUB conversion using cURL command

We can also use the cURL command-line tool to access Aspose.Words Cloud web services easily. But owing to security restrictions, you need to first generate a JSON Web Token (JWT) based on ClientID and ClientSecret details retrieved from Aspose.Cloud dashboard. Please execute the following command in the terminal to generate the JWT token.

curl -v "" \
-d "grant_type=client_credentials&client_id=4ccf1790-accc-41e9-8d18-a78dbb2ed1aa&client_secret=caac6e3d4a4724b2feb53f4e460eade3" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"

Now that we have got the JWT access token, we can upload the input MOBI file to cloud storage using following command. If the content is multipart and we do not provide the file name, it tries to get them from filename parameter from Content-Disposition header.

curl -X PUT "" \
-H  "accept: application/json" \
-H  "Authorization: Bearer <JWT Token>" \
-H  "Content-Type: multipart/form-data" \
-d {"fileContent":{}}

We have now uploaded the file to cloud storage, so following command can be used to perform the conversion operation and resultant EPUB is also saved in Cloud straoge.

curl -X GET "" \
-H  "accept: application/octet-stream" \
-H  "Authorization: Bearer <JWT Token>"


In this blog, we have explored the capabilities of Aspose.Words Cloud for document conversion. We have specifically discussed the steps on how we can convert MOBI eBook format to EPUB format using C# .NET and cURL command. Furthermore, you may also test our APIs in swagger interface and perform all document processing operations.

Nevertheless, our Cloud SDKs are distributed under an MIT license, therefore the complete code snippet for Aspose.Words Cloud SDK for .NET can be downloaded from GitHub. In case you encounter any issue or have any query while using the API, please feel free to contact through the Free product support forum.

Related articles

We also recommend visiting the following links to learn more about