Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsJul 16, 2026·3 min de lectura

EasyExcel — Fast Memory-Efficient Excel Processing for Java

Alibaba's open-source Java library for reading and writing large Excel files without running out of memory. Handles millions of rows with minimal heap usage through streaming and event-driven parsing.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
EasyExcel
Comando de instalación directa
npx -y tokrepo@latest install e42b53dc-80f4-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

Introduction

EasyExcel is a Java library by Alibaba designed to solve the memory overflow problems that plague Apache POI when handling large spreadsheets. It uses an event-driven SAX-style parser for reads and a streaming writer for exports, keeping memory usage flat regardless of file size.

What EasyExcel Does

  • Reads Excel files (xls and xlsx) with constant memory consumption via streaming
  • Writes large datasets to Excel with automatic sheet splitting and style support
  • Maps Excel columns to Java objects through annotations for type-safe parsing
  • Supports custom converters, validators, and listeners for complex data pipelines
  • Handles merged cells, formulas, images, and multi-sheet workbooks

Architecture Overview

EasyExcel wraps Apache POI's low-level SAX event reader for xlsx and the legacy HSSFEventFactory for xls, exposing a high-level annotation-based API. During reads, rows stream through a listener callback one at a time so only a small window of data resides in memory. Writes use a streaming workbook that flushes rows to disk in batches. A reflection-based converter layer automatically maps between Excel cells and annotated Java fields.

Self-Hosting & Configuration

  • Add the Maven or Gradle dependency to your project — no external services required
  • Annotate Java model classes with @ExcelProperty to map columns by name or index
  • Implement a ReadListener to process rows as they stream in from the file
  • Configure write styles, column widths, and merge strategies via builder methods
  • Use the fill template feature to populate pre-designed Excel templates with data

Key Features

  • Reads a 750,000-row file using roughly 64 MB of heap versus multiple GB with POI
  • Annotation-driven column mapping eliminates manual cell-index bookkeeping
  • Built-in support for Excel template filling for report generation
  • Automatic type conversion between Java types and Excel cell formats
  • Compatible with both legacy .xls and modern .xlsx file formats

Comparison with Similar Tools

  • Apache POI — the standard Java Excel library but loads entire workbooks into memory; EasyExcel wraps POI's SAX layer for constant-memory streaming
  • JExcelApi — lightweight xls-only library; lacks xlsx support and is no longer maintained
  • Alibaba DataX — a data synchronization tool, not an Excel library; complementary rather than competing
  • OpenCSV — handles CSV files only; EasyExcel covers the full xlsx/xls format including styles and formulas
  • Python openpyxl / pandas — popular in the Python ecosystem; EasyExcel serves the same role for Java and Spring Boot projects

FAQ

Q: How much memory does EasyExcel use for large files? A: EasyExcel processes rows one at a time via streaming, so heap usage stays constant (typically 64-128 MB) regardless of file size.

Q: Can I use EasyExcel with Spring Boot? A: Yes. It is a plain Java library that works in any Spring Boot project. Many teams use it for REST endpoints that export reports.

Q: Does EasyExcel support writing styled Excel files? A: Yes. You can apply cell styles, fonts, colors, column widths, and merged regions through the write builder API.

Q: Is EasyExcel actively maintained? A: Yes. Alibaba continues to release updates and the project has an active community on GitHub.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados