excelize is a free, open source marketing & customer engagement project written in Go and released under BSD-3-Clause. It has 20,918 GitHub stars, 1,949 forks and 131 open issues, and was last pushed 2 days ago. On this registry it ranks #5 of 50 tracked projects in Marketing & Customer Engagement, with 5 head-to-head comparisons available. It gained 8 stars over the last 3 tracked days.

What is excelize?

Excelize is a pure Go library for reading and writing XLAM, XLSM, XLSX, XLTM and XLTX spreadsheets, built for Go developers who need to generate or parse Microsoft Excel 2007 and later workbooks directly from their own code.

What it is

Excelize is a BSD-3-Clause licensed Go library that provides a set of functions for reading from and writing to spreadsheet files in the XLAM, XLSM, XLSX, XLTM and XLTX formats. It handles documents produced by Microsoft Excel 2007 and later, implements the ECMA-376 part of that ecosystem, and is distributed as the Go module github.com/xuri/excelize/v2. The project requires Go version 1.25.0 or later. It has drawn 20,915 stars and 1,949 forks, with 131 open issues and a last push in September 2026.

The API is small and direct. excelize.NewFile() creates a workbook, f.NewSheet("Sheet2") adds a worksheet, f.SetCellValue writes a cell, f.SetActiveSheet selects the visible sheet, and f.SaveAs("Book1.xlsx") writes the result. excelize.OpenFile reads an existing workbook back, and f.GetCellValue and f.GetRows extract single cells or whole row sets.

The concrete problem it solves is generating or consuming real Excel files from server-side Go code without driving the Excel application and without hand-assembling Office Open XML parts. It covers complex components with high compatibility, including charts and embedded pictures, and it exposes a streaming API for generating or reading data from a worksheet that holds very large amounts of data — the case where loading an entire sheet into memory is not viable.

Key capabilities

  • Reads and writes five workbook formats: XLAM, XLSM, XLSX, XLTM and XLTX.
  • Streaming API for generating or reading worksheet data at large volume.
  • Chart authoring through f.AddChart with excelize.Chart, including the excelize.Col3DClustered type, excelize.ChartSeries, and excelize.ChartTitle built from excelize.RichTextRun values.
  • Picture insertion through f.AddPicture with excelize.GraphicOption for scaling, using the standard image/gif, image/jpeg and image/png decoders.
  • Cell and sheet operations including excelize.CoordinatesToCellName, f.SetSheetRow, f.NewSheet and f.SetActiveSheet.
  • Formula support, listed among the project's repository topics alongside ecma-376 and office.
  • Repository topics agent, ai, mcp and analytics point to use alongside AI tooling and analytics pipelines.

Who uses it and how

  • Go backend services that emit XLSX exports on request, without an Excel installation on the host.
  • Data and analytics teams writing large reports, where the streaming API avoids holding a full worksheet in memory.
  • Teams producing charted workbooks programmatically, using chart series bound to worksheet ranges such as Sheet1!$B$2:$D$2.
  • Developers integrating spreadsheet output into agent or MCP-based tooling, per the repository topics.
  • Downstream projects and forks — 1,949 of them — building on the permissive BSD-3-Clause terms.

Getting started

Install with Go Modules using go get github.com/xuri/excelize/v2. Documentation is available through Go's built-in documentation tool, at https://pkg.go.dev/github.com/xuri/excelize/v2, and at the project site https://xuri.me/excelize.

How it compares

No comparable or paid products are listed in the facts provided for this project, and no similar tools are named alongside it. On the evidence available, Excelize stands alone in this registry.

When to use it — and when not to

A self-hoster operates nothing beyond a Go toolchain, since Excelize is a library rather than a service and no database, storage, or SMTP component is involved. The real constraint is the Go version requirement: version 1.25.0 or later is mandatory, so teams pinned to older toolchains cannot adopt it, and projects not written in Go should look elsewhere. The 131 open issues, and documentation split across three locations, are worth weighing before committing.

project readme (upstream, from github) — read inline

Build Status Code Coverage go.dev Licenses Donate

Excelize

Introduction

Excelize is a library written in pure Go providing a set of functions that allow you to write to and read from XLAM / XLSM / XLSX / XLTM / XLTX files. Supports reading and writing spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports complex components by high compatibility, and provided streaming API for generating or reading data from a worksheet with huge amounts of data. This library needs Go version 1.25.0 or later. The full docs can be seen using go's built-in documentation tool, or online at go.dev and docs reference.

Basic Usage

Installation

go get github.com/xuri/excelize
  • If your packages are managed using Go Modules, please install with following command.
go get github.com/xuri/excelize/v2

Create spreadsheet

Here is a minimal example usage that will create spreadsheet file.

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)
        }
    }()
    // Create a new sheet.
    index, err := f.NewSheet("Sheet2")
    if err != nil {
        fmt.Println(err)
        return
    }
    // Set value of a cell.
    f.SetCellValue("Sheet2", "A2", "Hello world.")
    f.SetCellValue("Sheet1", "B2", 100)
    // Set active sheet of the workbook.
    f.SetActiveSheet(index)
    // Save spreadsheet by the given path.
    if err := f.SaveAs("Book1.xlsx"); err != nil {
        fmt.Println(err)
    }
}

Reading spreadsheet

The following constitutes the bare to read a spreadsheet document.

package main

import (
    "fmt"

    "github.com/xuri/excelize/v2"
)

func main() {
    f, err := excelize.OpenFile("Book1.xlsx")
    if err != nil {
        fmt.Println(err)
        return
    }
    defer func() {
        // Close the spreadsheet.
        if err := f.Close(); err != nil {
            fmt.Println(err)
        }
    }()
    // Get value from cell by given worksheet name and cell reference.
    cell, err := f.GetCellValue("Sheet1", "B2")
    if err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println(cell)
    // Get all the rows in the Sheet1.
    rows, err := f.GetRows("Sheet1")
    if err != nil {
        fmt.Println(err)
        return
    }
    for _, row := range rows {
        for _, colCell := range row {
            fmt.Print(colCell, "\t")
        }
        fmt.Println()
    }
}

Add chart to spreadsheet file

With Excelize chart generation and management is as easy as a few lines of code. You can build charts based on data in your worksheet or generate charts without any data in your worksheet at all.

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)
        }
    }()
    for idx, row := range [][]interface{}{
        {nil, "Apple", "Orange", "Pear"}, {"Small", 2, 3, 3},
        {"Normal", 5, 2, 4}, {"Large", 6, 7, 8},
    } {
        cell, err := excelize.CoordinatesToCellName(1, idx+1)
        if err != nil {
            fmt.Println(err)
            return
        }
        f.SetSheetRow("Sheet1", cell, &row)
    }
    if err := f.AddChart("Sheet1", "E1", &excelize.Chart{
        Type: excelize.Col3DClustered,
        Series: []excelize.ChartSeries{
            {
                Name:       "Sheet1!$A$2",
                Categories: "Sheet1!$B$1:$D$1",
                Values:     "Sheet1!$B$2:$D$2",
            },
            {
                Name:       "Sheet1!$A$3",
                Categories: "Sheet1!$B$1:$D$1",
                Values:     "Sheet1!$B$3:$D$3",
            },
            {
                Name:       "Sheet1!$A$4",
                Categories: "Sheet1!$B$1:$D$1",
                Values:     "Sheet1!$B$4:$D$4",
            }},
        Title: excelize.ChartTitle{
            Paragraph: []excelize.RichTextRun{
                {
                    Text: "Fruit 3D Clustered Column Chart",
                },
            },
        },
    }); err != nil {
        fmt.Println(err)
        return
    }
    // Save spreadsheet by the given path.
    if err := f.SaveAs("Book1.xlsx"); err != nil {
        fmt.Println(err)
    }
}

Add picture to spreadsheet file

package main

import (
    "fmt"
    _ "image/gif"
    _ "image/jpeg"
    _ "image/png"

    "github.com/xuri/excelize/v2"
)

func main() {
    f, err := excelize.OpenFile("Book1.xlsx")
    if err != nil {
        fmt.Println(err)
        return
    }
    defer func() {
        // Close the spreadsheet.
        if err := f.Close(); err != nil {
            fmt.Println(err)
        }
    }()
    // Insert a picture.
    if err := f.AddPicture("Sheet1", "A2", "image.png", nil); err != nil {
        fmt.Println(err)
    }
    // Insert a picture to worksheet with scaling.
    if err := f.AddPicture("Sheet1", "D2", "image.jpg",
        &excelize.GraphicOptions{ScaleX: 0.5, ScaleY: 0.5}); err != nil {
        fmt.Println(err)
    }
    // Insert a picture offset in the cell with printing support.
    enable, disable := true, false
    if err := f.AddPicture("Sheet1", "H2", "image.gif",
        &excelize.GraphicOptions{
            PrintObject:     &enable,
            LockAspectRatio: false,
            OffsetX:         15,
            OffsetY:         10,
            Locked:          &disable,
        }); err != nil {
        fmt.Println(err)
    }
    // Save the spreadsheet with the origin path.
    if err = f.Save(); err != nil {
        fmt.Println(err)
    }
}

Contributing

Contributions are welcome! Open a pull request to fix a bug, or open an issue to discuss a new feature or change. XML is compliant with part 1 of the 5th edition of the ECMA-376 Standard for Office Open XML.

Licenses

This program is under the terms of the BSD 3-Clause License. See https://opensource.org/licenses/BSD-3-Clause.

The Excel logo is a trademark of Microsoft Corporation. This artwork is an adaptation.

The Go gopher was created by Renee French. Licensed under the Creative Commons 4.0 Attributions license.

Gold Sponsors

Gravity

Frequently asked questions

Is excelize free to use?

excelize is open source under the BSD-3-Clause licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does excelize do?

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets

What is excelize written in?

excelize is primarily written in Go. Its source is publicly available at https://github.com/qax-os/excelize, and it has 20,918 GitHub stars.