Apache POI Tutorials
Apache POI is mostly used for reading and writing Excel documents. POI API allows Java programmers to interact with Microsoft Office documents. MS Office documents such as Word, Excel, and PowerPoint Presentation files. POI API is an open source tool developed by The Apache Software Foundation.

Apache POI is an open-source Java library that enables developers to create, modify, and read various file formats that are based on Microsoft Office documents. Using Apache POI, you can perform operations like creation, modification, and display or reading of the following Microsoft Office file formats:
-
DOC (97-2003 Word Document) – Allows reading and writing of Word documents from the older 97-2003 version of Microsoft Word.
-
DOCX (2007/2010/2013 Word Document) – Supports working with Word documents from the 2007 and later versions, including DOCX formats used in Microsoft Word 2007, 2010, and 2013.
-
PPT (97-2003 PowerPoint Presentation) – Enables manipulation of PowerPoint presentations created in older versions (97-2003).
-
PPTX (2007/2010/2013 PowerPoint Presentation) – Allows manipulation of PowerPoint presentations from the 2007, 2010, and 2013 versions that use the PPTX file format.
-
XLS (97-2003 Excel Spreadsheet) – Supports reading and writing Excel spreadsheets from the older Excel versions (97-2003).
-
XLSX (2007/2010/2013 Excel Spreadsheet) – Provides functionality for working with Excel spreadsheets created in the 2007 and later versions, specifically those saved in the XLSX format.
In addition to these core Microsoft Office formats, Apache POI also includes components that can provide basic reading functionality for some other Microsoft Office file formats, including:
Overall, Apache POI is a powerful tool for working with Microsoft Office documents in Java, supporting both legacy formats and more recent file types.
A working Java environment is a prerequisite for Apache POI. We have to download & install Java JDK.
Download
Add POI Jars to Project
Apache POI Components
Workbook Interface
Read an Excel File
Write an Excel File
Update an Excel File
Like Apache POI, there are many APIs from different vendors. Some of the examples of APIs from other vendors are JXL, JExcel API, etc.
Why Apache POI for Excel?
Apache POI is widely used for reading and writing Excel documents, and while there are other libraries available for performing operations on Excel files, Apache POI is often the preferred choice for several reasons:
-
It’s Free:
Apache POI is an open-source library, meaning it’s free to use. On the other hand, Aspose Cells for Java is a commercial product that requires a paid license.
-
Support for Both XLS and XLSX Formats:
Apache POI supports both the older XLS format (Excel 97-2003) and the newer XLSX format (Excel 2007 and later). In contrast, Java JXL (JExcel) only supports the older XLS format and does not have support for the XLSX format, which became the standard starting from Excel 2007.
-
Active Development and Open Source Community:
Apache POI is actively maintained and developed by a large community of open-source enthusiasts. This means regular updates, improvements, and bug fixes. On the other hand, JExcel is not actively developed anymore, which may cause limitations in support and compatibility with newer Excel features.
Overall, Apache POI’s active development, wide format support (XLS and XLSX), and its free, open-source nature make it the most popular and preferred choice for working with Excel files in Java.