Open Source · MIT Licensed

Read, write, and calculate Excel files in pure Go.

Zero dependencies. Compiled formula engine. Sparse cell storage. The Excel library Go has been missing.

main.go
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.

Write
f := werkbook.New()
s := f.Sheet("Sheet1")
s.SetValue("A1", "Revenue")
s.SetValue("B1", 583200)
f.SaveAs("report.xlsx")
Read
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.

SUM VLOOKUP IF INDEX AVERAGE COUNTIF CONCATENATE +48 more

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.

Read ZIP/XML → OOXML → File/Sheet/Cell
Write File/Sheet/Cell → OOXML → ZIP/XML

100% open source

MIT-licensed with 55 built-in functions. Free forever, community-driven, and open to contributions.

License MIT
Cost Free forever

Standard library only

Zero external dependencies. Built entirely on Go's standard library. No CGo, no system libraries, no surprises in your dependency tree.

External dependencies
0
CGo required No

Up and running in seconds

One import. No configuration. No external dependencies.

1

Install

go get github.com/jpoz/werkbook
2

Create

f := werkbook.New() s := f.Sheet("Sheet1") s.SetValue("A1", "Hello")
3

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.