excelize

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

Library
Go
vv2.11.0
20,906stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
86/100Excellent
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 →
83/100Excellent
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

Go
92%
AGPL 3.0

BillionMail

Marketing

15,596

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

View details
53
Repo Health
74
Technical
70
Dependency
Built with
Go92%
Updated 3 months ago
Go
50%
MIT

Bytebase

Devops

14,484

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.

View details
92
Repo Health
73
Technical
68
Dependency
Built with
Go50%
TypeScript42%
Updated 2 days ago
Go
37%
MIT

ezBookkeeping

Invoicing Finance

5,578

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

View details
88
Repo Health
80
Technical
72
Dependency
Built with
Go37%
Vue34%
TypeScript25%
Updated 3 days ago
Other

Magic

AI Agents · Automation · Low Code Platforms

5,032

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.

View details
71
Repo Health
79
Technical
0
Dependency
Go
40%
Apache 2.0

Rill

Analytics · Data Engineering

2,882

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

View details
88
Repo Health
88
Technical
64
Dependency
Built with
Go40%
TypeScript37%
Svelte21%
Updated 3 days ago
Go
54%
MPL 2.0

shaper

Analytics · Data Engineering

1,248

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

View details
80
Repo Health
79
Technical
74
Dependency
Built with
Go54%
TypeScript45%
Updated 3 days ago

Join founders buildingwith open source

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

Subscribe on Substack
Join 750+ subscribers

Search