avadim / fast-excel-reader
Lightweight and very fast XLSX Excel Spreadsheet and CSV Reader in PHP
Requires
- php: >=7.4
- ext-ctype: *
- ext-mbstring: *
- ext-xmlreader: *
- ext-zip: *
- avadim/fast-excel-helper: ^1.3
Requires (Dev)
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2026-07-22 20:38:10 UTC
README
FastExcelReader
π¬π§ English Β· π·πΊ Π ΡΡΡΠΊΠΈΠΉ
FastExcelReader is a part of the FastExcelPhp Project which consists of
- FastExcelWriter - to create Excel spreadsheets
- FastExcelReader - to reader Excel spreadsheets and CSV-files
- FastExcelTemplator - to generate Excel spreadsheets from XLSX templates
- FastExcelLaravel - special Laravel edition
Introduction
This library is designed to be lightweight, super-fast and requires minimal memory usage.
FastExcelReader can read Excel compatible spreadsheets in XLSX format (Office 2007+), legacy XLS format (Office 97-2003) and CSV-files. It only reads data, but it does it very quickly and with minimal memory usage.
Features
XLSX format support
- Supports XLSX format (Office 2007+) with multiple worksheets
- Supports autodetect currency/numeric/date types
- Supports auto formatter and custom formatter of datetime values
- The library can define and extract images from XLSX files
- The library can read styling options of cells - formatting patterns, colors, borders, fonts, etc.
XLS format support
- Supports legacy XLS format (Office 97-2003, BIFF8) with the same API as XLSX
- Values, dates, cell styles, formula text and images are all returned in the same shape
- The format is chosen by the file signature, not by the extension
- Streaming as well: a sheet is read in one forward pass with constant memory
CSV format support
- Delimiter Detection: Automatic detection or manual specification of column delimiters.
- Wide Encoding Support: Any encoding supported by your PHP environment
- Supports fields with or without quotes, and escaped quotes (doubled quotes).
- Multi-line Fields Handles line breaks within quoted fields.
- Two modes - strict (follows RFC 4180) and tolerant (with non-standard CSV files)
Installation
Use composer to install FastExcelReader into your project:
composer require avadim/fast-excel-reader
Quick start
use \avadim\FastExcelReader\Excel; // XLSX and legacy XLS are both opened this way; the reader is chosen by the file signature $excel = Excel::open(__DIR__ . '/files/demo.xlsx'); // Read all rows into a two-dimensional array (ROW x COL) $rows = $excel->readRows(); // Or read row by row (memory efficient) $sheet = $excel->sheet(); foreach ($sheet->nextRow() as $rowNum => $rowData) { // handle $rowData }
See more in the Getting Started guide.
Documentation
Guides
- Getting Started β read cells, rows and columns
- Reading Data β row by row, array keys, empty cells & rows
- Advanced Reading β read areas, defined names, callbacks
- Cell Value Types & Date Formatter
- Cell Styles β read complete style info of cells
- Images β extract images from XLSX
- Sheet Metadata β data validation, column widths, row heights, freeze pane, tab color, merged cells, dimensions
- CSV Parsing β reading CSV files
- XLS (Excel 97-2003) β reading legacy XLS workbooks
API Reference
Examples
You can find more examples in the /demo folder.
Changelog
See CHANGELOG.md for the list of changes.
Do you want to support FastExcelReader?
if you find this package useful you can give me a star on GitHub.
Or you can donate me :)
- USDT (TRC20) TSsUFvJehQBJCKeYgNNR1cpswY6JZnbZK7
- USDT (ERC20) 0x5244519D65035aF868a010C2f68a086F473FC82b
- ETH 0x5244519D65035aF868a010C2f68a086F473FC82b