Skip to content
Package86 repository health

excelize

A pure Go library for reading, writing, and streaming Microsoft Excel spreadsheets, from cell values to charts and pivot tables.

Library Govv2.11.121,140 stars BSD 3-Clause License
go get github.com/xuri/excelize/v2
View sourceVisit website

Repository health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
Excellent
  • Development activity96
  • Maintenance72
  • Community76
  • Maturity60
  • Momentum40

Technical analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
Excellent
  • Architecture85
  • Code quality88
  • Innovation80
  • Learning curve80

Excelize is a pure Go library for creating, reading, and modifying Microsoft Excel spreadsheets in the XLSX, XLSM, XLTM, XLTX, and XLAM formats. It exposes a high-level File API for setting cell values, styles, formulas, charts, pivot tables, and images, and provides a dedicated streaming writer and row iterator for worksheets containing very large amounts of data.

Beyond basic cell manipulation, excelize implements a substantial subset of Excel’s formula-calculation engine, along with data validation, conditional formatting, sparklines, slicers, and VBA project handling — making it suitable for both simple report generation and more complex spreadsheet tooling that would otherwise require shelling out to Excel or LibreOffice.

What You Get

  • A full cell-level API for reading and writing values, formulas, styles, and comments across worksheets
  • A streaming writer and reader for handling worksheets with hundreds of thousands of rows efficiently
  • Built-in chart, pivot table, sparkline, and slicer generation
  • A formula calculation engine covering a large portion of Excel’s built-in function library
  • Support for images, VBA projects, and workbook encryption/decryption

Common Use Cases

  • Generating downloadable Excel reports from backend Go services
  • Bulk importing and exporting large datasets to and from XLSX files via the streaming API
  • Populating spreadsheet templates with dynamic charts and pivot tables for recurring reports
  • Parsing and evaluating formulas in user-uploaded spreadsheets

Under The Hood

Architecture

Excelize centers on a single File struct (excelize.go) that holds the in-memory representation of a workbook: parsed XML parts (WorkBook, Styles, SharedStrings, Comments, Drawings), a sync.Mutex for exclusive operations plus several sync.Map fields (Sheet, Pkg, Relationships, checked, calcCache) that let concurrent goroutines safely read and mutate independent worksheets — verified by an explicit TestConcurrency test that hammers SetCellValue/GetCellValue/SetSheetRow from multiple goroutines. Functionality is split across dozens of flat top-level files by concern rather than nested packages (cell.go, styles.go, chart.go, pivotTable.go, calc.go, drawing.go, crypt.go), each operating on the same File receiver; XML marshaling structs live in separate xml*.go files, decoupling the public API surface from the underlying OOXML schema. Reading and writing both funnel through archive/zip (with a pluggable ZipWriter interface for custom archive backends), so the same File model serves the streaming writer (stream.go), the calculation engine (calc.go), and standard save/open paths.

Tech Stack

Written in pure Go (module github.com/xuri/excelize/v2, requiring Go 1.25+) with a deliberately small dependency surface: golang.org/x/net, golang.org/x/image, and golang.org/x/text for encoding/image support, github.com/richardlehane/mscfb and msoleps for legacy OLE/compound-file parsing (VBA projects), github.com/xuri/efp for formula tokenizing, github.com/xuri/nfp for number-format parsing, and github.com/tiendc/go-deepcopy for struct cloning. testify is the only test dependency. There is no ORM, web framework, or database layer — the library’s only I/O surface is the filesystem and in-memory ZIP archives, and its CI matrix (GitHub Actions) builds and tests across Linux, macOS, Windows, and multiple CPU architectures (ARM, RISC-V) on three upcoming Go versions.

Code Quality

The project has extensive test coverage — 31 _test.go files with roughly 430 top-level test functions, generally one per exported API, using table-driven cases with testify/assert and fixture XLSX files under test/. Error handling is explicit and typed: errors.go defines dozens of named sentinel errors (ErrCellCharsLength, ErrColumnNumber, ErrDefinedNameDuplicate, …) returned directly from API functions rather than panics or swallowed errors, and most public methods return (value, error) pairs consistent with idiomatic Go. CI runs go vet and cross-compiles for multiple architectures on every push. Code coverage is tracked via Codecov, and naming follows Go conventions (exported CamelCase, doc comments on every exported symbol).

What Makes It Unique

Unlike most spreadsheet libraries that only handle cell values and basic formatting, excelize reimplements a working subset of Excel’s own formula engine (CalcCellValue in calc.go, hundreds of built-in functions) entirely in Go, letting consumers evaluate spreadsheet formulas without Excel, LibreOffice, or a headless browser. It also goes deep into OOXML features that competing libraries typically skip — pivot tables, slicers, sparklines, VBA project attachment/extraction, and workbook encryption/decryption — while still offering a streaming writer for very large datasets, combining breadth of Excel-format fidelity with memory-conscious APIs in one dependency-light package.

Used by 6 apps in this directory

Every app whose dependencies include github.com/xuri/excelize/v2, nine to a page.

Go 92%AGPL 3.0

BillionMail

16,441

Marketing

Self-hosted email server and marketing platform that gives you unlimited sending, full deliverability control, and AI-assisted campaigns without monthly fees.

App
Built with
  • Go 92%
Updated 5 months agoView details
TypeScript 55%MIT

Bytebase

14,721

Devops

An open-source database CI/CD and DevSecOps platform — schema migration review, GitOps-driven changes, data masking, and access control across MySQL, PostgreSQL, Oracle, Snowflake, MongoDB, and more.

App
Built with
  • TypeScript 55%
  • Go 39%
Updated todayView details
Go 39%MIT

ezBookkeeping

6,104

Invoicing Finance

Lightweight self-hosted personal finance manager with AI receipt scanning, multi-currency support, and MCP integration for complete data privacy.

App
Built with
  • Go 39%
  • Vue 32%
  • TypeScript 25%
Updated todayView details
TypeScript 51%Other

Magic

5,092

AI Agents · Automation · Low Code Platforms

Magic is an enterprise-grade open-source AI agent platform combining a generalist AI agent, workflow engine, IM, and collaborative office system for running an AI-powered digital workforce.

App
Built with
  • TypeScript 51%
  • PHP 24%
  • Python 11%
Updated 4 weeks agoView details
Go 40%Apache 2.0

Rill

3,007

Analytics · Data Engineering

The fastest BI tool for humans and agents — define metrics, models, and dashboards as code and query them instantly on ClickHouse or DuckDB.

App
Built with
  • Go 40%
  • TypeScript 39%
  • Svelte 19%
Updated yesterdayView details
Go 56%MPL 2.0

shaper

1,281

Analytics · Data Engineering

Build analytics dashboards, reports, and customer-facing analytics by writing pure SQL — powered by DuckDB and designed for self-hosted deployment.

App
Built with
  • Go 56%
  • TypeScript 42%
Updated yesterdayView details

Join founders building with open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on SubstackJoin 750+ subscribers