Skip to content

XLFill

A Go library that lets you design Excel templates visually and fill them with data — without writing a single line of styling code.

You know that feeling when you open Excel and just make a report look right? The fonts, the colors, the borders — it takes a few minutes and it looks professional. Now imagine dropping a Go library into your project that fills that template with live data. That’s XLFill.

Here’s a template you’d design:

An Excel template with expressions like ${e.name} and a jx:each command in a cell comment

And here’s what XLFill produces:

The filled Excel output with real employee data, all formatting preserved

Same fonts. Same colors. Same borders. You didn’t write a single line of code for any of that styling. The template is the design.


1. Design in Excel

Open any spreadsheet editor — Excel, Google Sheets, LibreOffice, whatever you prefer. Make your report look exactly right. Headers, colors, borders, number formats, logos. Save as .xlsx.

2. Drop in a few annotations

Put ${employee.Name} in cells where data should go. Add a jx:each(...) command in a cell comment to define a loop. That’s it — two things to learn.

3. Fill from Go

One function call: xlfill.Fill("template.xlsx", "output.xlsx", data). Your data flows into the template. Every pixel of formatting — preserved.

4. Ship it

Your users get a real .xlsx file. Opens in Excel, Google Sheets, LibreOffice. Not a CSV. Not an HTML table someone has to squint at. A proper, beautiful spreadsheet.


If you’ve ever built Excel reports in Go (or any language, really), this table will feel painfully familiar:

The old way (cell-by-cell code)With XLFill (template-first)
How you designLine by line in Go codeVisually in Excel — like a normal person
Changing the layoutEdit code, rebuild, redeploy, prayEdit the .xlsx file. Done.
Who can update it?Only developersAnyone who knows Excel
Styling & formatting20 lines of verbose struct literals per styleIt’s already in the template
FormulasBuild formula strings by handWrite them in Excel — XLFill expands them
Merged cellsCode the exact rangesJust merge them in Excel
Conditional formattingMost libraries don’t even support itIt’s in the template — just works
Code complexityGrows with every column, every sectionStays tiny — your code only provides data
When something breaksGood luck debugging fmt.Sprintf("A%d", row+2)Open the template. Look at it.

“I used to spend 200 lines of Go code wrestling with cell styles, merging headers, and adjusting column widths. Then one day our finance team redesigned the whole report. I had to rewrite everything. Now? My business analyst designs the template in Excel, and my Go code is 10 lines. When they want changes, they just update the template. I don’t even hear about it.”

That’s the shift. The template becomes the single source of truth for how the report looks. Your code becomes the single source of truth for the data. Nobody steps on each other’s toes.


See the full case

Read Why XLFill? — a detailed breakdown with real Go code showing 40+ lines of hard-coded pain reduced to 3 lines.

Just try it

Get started — install, build a template, fill it with data. Five minutes, start to finish.