# Convert eBook formats In this article, you will learn how to convert eBook formats with GroupDocs.Conversion for Java. ## About eBook file formats eBook files are electronic files that can be opened on digital devices known as eReaders. An eReader can be any device such as a computer, a tablet, or a smartphone. The most popular eBook file format is the XML-based ePub. An eBook can contain different types of content such as text, images, and video. Common eBook file extensions and their file formats include EPUB (electronic publication), FB2 (FictionBook 2.0), and Mobi (MobiPocket eBook File). ## Supported eBook file conversions {{< include file="/conversion/java/_includes/supported-conversions/ebook.md" type="page" >}} ## Convert from eBook formats With [GroupDocs.Conversion](https://products.groupdocs.com/conversion/java) you can easily convert your eBook document into another file format. For example, an eBook to PDF conversion code snippet looks like this: {{< tabs "convert-ebook-mobi-to-pdf">}} {{< tab "Java" >}} ```java import com.groupdocs.conversion.Converter; import com.groupdocs.conversion.options.convert.PdfConvertOptions; // Load the source eBook file Converter converter = new Converter("sample.mobi"); // Set the convert options for PDF format PdfConvertOptions options = new PdfConvertOptions(); // Convert to PDF format converter.convert("converted.pdf", options); ``` {{< /tab >}} {{< /tabs >}} Put it simply - you just load an eBook file into the `Converter` class, select the desired output format and **GroupDocs.Conversion** does all the rest. {{< alert style="info" >}} Refer to the [API reference](https://reference.groupdocs.com/conversion/java/groupdocs.conversion.options.convert) for more conversion options and customizations. {{< /alert >}} ## Convert to eBook formats On the other hand, converting your files to eBook format is also quite simple and natural. Minimally, all you need is to specify the desired output format in the `setFormat` method of the [EBookConvertOptions](https://reference.groupdocs.com/conversion/java/groupdocs.conversion.options.convert/ebookconvertoptions/) class instance. The following code snippet shows how to convert a PDF document to eBook format in Java using [GroupDocs.Conversion](https://products.groupdocs.com/conversion/java). {{< tabs "convert-pdf-to-ebook-epub">}} {{< tab "Java" >}} ```java import com.groupdocs.conversion.Converter; import com.groupdocs.conversion.options.convert.EBookConvertOptions; import com.groupdocs.conversion.filetypes.EBookFileType; // Load the source PDF file Converter converter = new Converter("sample.pdf"); // Set the convert options for eBook format EBookConvertOptions options = new EBookConvertOptions(); options.setFormat(EBookFileType.Epub); // Convert to eBook format converter.convert("converted.epub", options); ``` {{< /tab >}} {{< /tabs >}}