Pure go library for creating Office Open/OOXML/ECMA-376 documents (.docx, .xlsx, .pptx)
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github meta: add github issue template Sep 6, 2017
_examples spreadsheet: support rotated cells Dec 19, 2018
algo spreadsheet: fix for sheet ordering bug Feb 6, 2018
chart gooxml: clean up some old TODOs Sep 30, 2017
cmd document: refactor properties Oct 10, 2017
color Added RGBA constructor. Dec 28, 2018
common spreadsheet: add a RemoveCalcChain function Oct 17, 2018
document document: look for merge fields in tables Nov 29, 2018
drawing drawing: support flipped shapes Nov 30, 2017
measurement spreadsheet: add support for column formatting Sep 9, 2017
presentation schema: unit test for issue #207 Sep 30, 2018
schema Added empty struct to avoid nill pointer error Sep 30, 2018
spreadsheet spreadsheet: set custom row height attribute Dec 24, 2018
testdata document: read/restore all contents of a Word 2016 file Aug 30, 2017
testhelper spreadsheet: add comment support Sep 10, 2017
vmldrawing schema: rename officeDocument to ofc Sep 23, 2017
zippkg spreadsheet: fix for sheet ordering bug Feb 6, 2018
.gitignore example: remove binaries that shouldn't be committed Oct 10, 2017
.travis.yml meta: specify 1.11 specifically for travis Sep 12, 2018
CLA.md initial commit Aug 29, 2017
LICENSE initial commit Aug 29, 2017
LICENSE.commercial meta: add commercial EULA for those interested Oct 1, 2017
README.md presentation: add support for images Nov 21, 2017
build-examples.sh meta: update version info Jul 27, 2018
codecov.yml meta: rename codecov.yml Sep 2, 2017
creator.go meta: add more documentation Aug 30, 2017
creator_test.go schema: rename wordprocessingml to wml Sep 23, 2017
doc.go meta: remove extra quotes in doc Sep 7, 2017
example_test.go meta: add spreadsheet example Sep 7, 2017
filenames.go presentation: initial work for presentations Nov 18, 2017
filenames_test.go presentation: initial work for presentations Nov 18, 2017
go.mod meta: add go.mod Sep 14, 2018
license.go license: be more lenient regarding licensing formatting May 18, 2018
license_test.go gooxml: add support for verifying versions and license Oct 1, 2017
licensetype_string.go gooxml: add support for verifying versions and license Oct 1, 2017
log.go presentation: initial work for presentations Nov 18, 2017
mingo.go test: add more tests for xsdany and optional Sep 23, 2017
mingo_18.go meta: add compile time check for go1.8+ Sep 21, 2017
optional.go test: add more tests for xsdany and optional Sep 23, 2017
optional_test.go test: add more tests for xsdany and optional Sep 23, 2017
schemas.go presentation: initial work for presentations Nov 18, 2017
test-coverage.sh meta: test codecov.io Sep 23, 2017
update-godoc.sh meta: add more documentation Aug 30, 2017
update-version.sh document: Google docs writes out incorrect floating point values Sep 12, 2018
version.go common: generate unique relationship IDs Sep 14, 2018
xml.go document: fix space preserve on run text content Sep 2, 2017
xml_test.go gooxml: add more unit tests Sep 2, 2017
xsdany.go spreadsheet: don't allow extra content on Workbook Oct 5, 2017
xsdany_test.go schema: preserve extra content on CT_R/CT_SdtPr Sep 27, 2017


gooxml is a library for creation of Office Open XML documents (.docx, .xlsx and .pptx). It's goal is to be the most compatible and highest performance Go library for creation and editing of docx/xlsx/pptx files.

Requires go1.8+, builds are tested with 1.8, 1.9 and tip.

Build Status GitHub (pre-)release License: AGPL v3 GoDoc go 1.8+



  • Documents (docx) [Word]
    • Read/Write/Edit
    • Formatting
    • Images
    • Tables
  • Spreadsheets (xlsx) [Excel]
    • Read/Write/Edit
    • Cell formatting including conditional formatting
    • Cell validation (drop down combobox, rules, etc.)
    • Retrieve cell values as formatted by Excel (e.g. retrieve a date or number as displayed in Excel)
    • Formula Evaluation (100+ functions supported currently, more will be added as required)
    • Embedded Images
    • All chart types
  • PowerPoint (pptx) [PowerPoint]
    • Creation from templates
    • Textboxes/shapes


There has been a great deal of interest in performance numbers for spreadsheet creation/reading lately, so here are gooxml numbers for this benchmark which creates a sheet with 30k rows, each with 100 columns.

creating 30000 rows * 100 cells took 3.92506863s
saving took 89ns
reading took 9.522383048s

Creation is fairly fast, saving is very quick due to no reflection usage, and reading is a bit slower. The downside is that the binary is large (33MB) as it contains generated structs, serialization and deserialization code for all of DOCX/XLSX/PPTX.


go get baliance.com/gooxml/
go build -i baliance.com/gooxml/...

Document Examples

Spreadsheet Examples

Presentation Examples

Raw Types

The OOXML specification is large and creating a friendly API to cover the entire specification is a very time consuming endeavor. This library attempts to provide an easy to use API for common use cases in creating OOXML documents while allowing users to fall back to raw document manipulation should the library's API not cover a specific use case.

The raw XML based types reside in the schema/ directory. These types are accessible from the wrapper types via a X() method that returns the raw type.

For example, the library currently doesn't have an API for setting a document background color. However it's easy to do manually via editing the CT_Background element of the document.

dox := document.New()
doc.X().Background = wordprocessingml.NewCT_Background()
doc.X().Background.ColorAttr = &wordprocessingml.ST_HexColor{}
doc.X().Background.ColorAttr.ST_HexColorRGB = color.RGB(50, 50, 50).AsRGBString()

Contribution guidelines

CLA assistant

All contributors are must sign a contributor license agreement before their code will be reviewed and merged.


This library is offered under a dual license. It is freely available for use under the terms of AGPLv3. If you would like to use this library for a closed source project, please contact sales@baliance.com.

There are no differences in functionality between the open source and commercial versions. You are encouraged to use the open source version to evaluate the library before purchasing a commercial license.