Excelize is a pure Go library for creating, reading, and modifying Microsoft Excel spreadsheet files (XLAM, XLSM, XLSX, XLTM, XLTX). It targets Go developers who need to generate reports, import/export tabular data, or build automation that touches Excel files without shelling out to Office or relying on COM interop. It works with documents produced by Excel 2007 and later, and it aims for compliance with the ECMA-376 Office Open XML standard.
The library exposes a straightforward API: open a file, read cell values or rows, set values, add charts or pictures, and save. It also provides streaming APIs for cases where a worksheet holds a large amount of data and loading everything into memory isn't practical.
GetRows.CoordinatesToCellName for converting row/column indices to cell references.Excelize fits well when a Go backend needs to generate Excel reports on the fly, for example exporting database query results, analytics dashboards, or invoices as XLSX files for download. It's also a good fit for batch processing: reading uploaded spreadsheets, validating or transforming rows, and writing the result back out, all inside a Go service with no external dependencies.
It works for building charts and visual reports directly inside generated workbooks, and for embedding images (logos, screenshots, generated graphics) into spreadsheets programmatically. The streaming API makes it suitable for exporting or importing large datasets, such as tens of thousands of rows, where holding the entire workbook in memory would be wasteful.
It is not the right tool if you need a spreadsheet UI, formula engine parity with Excel's full function set, or real-time collaborative editing; Excelize is a file-format library, not an application. If your stack isn't Go, or if you need to manipulate legacy binary XLS (pre-2007) files exclusively, look elsewhere, since Excelize targets the OOXML-based formats used by Excel 2007 and later.
Excelize is distributed as a Go module. Add it to your project with go get:
go get github.com/xuri/excelize/v2
If your project doesn't use Go Modules yet, set that up first; Excelize versions above v1 are published under the /v2 module path.
A minimal example that creates a spreadsheet:
package main
import (
"fmt"
"github.com/xuri/excelize/v2"
)
func main() {
f := excelize.NewFile()
defer func() {
if err := f.Close(); err != nil {
fmt.Println(err)
}
}()
f.SetCellValue("Sheet1", "B2", 100)
if err := f.SaveAs("Book1.xlsx"); err != nil {
fmt.Println(err)
}
}
Reading a file follows the same pattern: call excelize.OpenFile("Book1.xlsx"), use GetCellValue or GetRows to pull data, and close the file when done. Full API docs are available at pkg.go.dev and the project's documentation site.