Read, write, and calculate Excel files in pure Go.
Zero dependencies. Compiled formula engine. Sparse cell storage. The Excel library Go has been missing.
package main import "github.com/jpoz/werkbook" func main() { f := werkbook.New() s := f.Sheet("Sheet1") s.SetValue("A1", "Revenue") s.SetValue("B1", 583200) s.SetFormula("B2", "SUM(B1:B1)*0.12") f.Recalculate() f.SaveAs("report.xlsx") }
Designed for correctness, not just convenience
A real formula engine, sparse storage, and a tagged union value system. Built to handle Excel the way Excel actually works.
Compiled formula engine
Lexer, parser, compiler, evaluator. Formulas are compiled to an AST with dependency tracking and evaluated in topological order.
Sparse cell storage
Rows and cells stored as maps, not arrays. A workbook with data in A1 and Z10000 uses memory for two cells, not millions.
Tagged union values
Every cell value carries its type: Number, String, Bool, Error, or Empty. No type guessing, no silent coercion.
Everything you need to work with Excel
Create workbooks from scratch, read existing files, set formulas, recalculate, and save — all through a clean Go API.
f := werkbook.New() s := f.Sheet("Sheet1") s.SetValue("A1", "Revenue") s.SetValue("B1", 583200) f.SaveAs("report.xlsx")
f, _ := werkbook.Open("report.xlsx") s := f.Sheet("Sheet1") v := s.Value("B1") fmt.Println(v.Number()) // 583200
55 built-in functions
Math, statistics, text, date, logic, and lookup. Registered via a pluggable function registry.
Full OOXML round-trip
Read an Excel file, modify it, and write it back without losing formatting, charts, or metadata. Proper ZIP/XML serialization throughout.
100% open source
MIT-licensed with 55 built-in functions. Free forever, community-driven, and open to contributions.
Standard library only
Zero external dependencies. Built entirely on Go's standard library. No CGo, no system libraries, no surprises in your dependency tree.
Up and running in seconds
One import. No configuration. No external dependencies.
Install
go get github.com/jpoz/werkbook Create
f := werkbook.New()
s := f.Sheet("Sheet1")
s.SetValue("A1", "Hello") Save
f.Recalculate()
f.SaveAs("output.xlsx") The Excel library Go has been missing
Zero dependencies. Compiled formula engine. 55 built-in functions. Read, write, and calculate Excel files in pure Go.