Find your next open-source project

Search by name, purpose, or keyword — or paste a GitHub repository URL

qax-os/excelize

Data

A pure Go library for reading and writing Excel XLSX and related spreadsheet files.

21,047
1,986
Go
BSD-3-Clause
10 years old

Project overview

Excelize is a pure Go library for reading and writing Microsoft Excel spreadsheet files in the XLAM, XLSM, XLSX, XLTM and XLTX formats, covering workbooks produced by Excel 2007 and later. It is aimed at Go developers who need to generate, modify or extract data from spreadsheets inside services, scripts and data pipelines.

The library exposes functions for common spreadsheet components, including cells, worksheets, charts and images, and ships a streaming API for generating or reading worksheets with very large amounts of data. Output XML follows the ECMA-376 Office Open XML standard README, ECMA-376. Full API documentation is available through Go's documentation tool, on go.dev API reference, and in the online docs documentation.

Quick start

Excelize requires Go 1.26.0 or later. With Go Modules enabled, add the v2 module:

go get github.com/xuri/excelize/v2

The import path for the module is github.com/xuri/excelize/v2. A minimal program that creates a workbook, writes two cells, adds a second sheet and saves the file looks like this example:

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)
        }
    }()
    index, err := f.NewSheet("Sheet2")
    if err != nil {
        fmt.Println(err)
        return
    }
    f.SetCellValue("Sheet2", "A2", "Hello world.")
    f.SetCellValue("Sheet1", "B2", 100)
    f.SetActiveSheet(index)
    if err := f.SaveAs("Book1.xlsx"); err != nil {
        fmt.Println(err)
    }
}

Running it writes Book1.xlsx to the working directory. Reading an existing file follows the same pattern: open with excelize.OpenFile("Book1.xlsx"), call GetCellValue for a single cell or GetRows for all rows of a sheet, then close the file reading example. The README also contains examples for adding charts chart example and pictures picture example.

Requirements and limits

  • Go version: Go 1.26.0 or later, with Go Modules recommended for dependency management installation.
  • File formats: XLAM, XLSM, XLSX, XLTM and XLTX; the library targets files generated by Excel 2007 and later.
  • Large data: use the streaming API rather than the regular worksheet functions when generating or reading worksheets with very large datasets.
  • License: BSD 3-Clause license. The bundled Excel and Go gopher artwork carry their own attribution terms.

HotRepo's take

On the 2026-11-03 Go daily list, Excelize recorded 13 new stars and a best position of 2, with a total of 21,046 stars and 1,986 forks. That single snapshot shows the project still attracts attention in the Go ecosystem, but it does not by itself establish a growth trend. The technical case rests on its position as a pure Go implementation of spreadsheet reading and writing with streaming support, which makes it a practical dependency for Go services that need to handle large Excel files.

Written by AI from the project's README, updated . The project's own docs are the source of truth.