Free, MIT-licensed fluent Excel generation for .NET. No commercial subscription required — ever.
EPPlus — the most widely used .NET Excel library — has required a paid annual subscription for any commercial use since v5 (free only under the restrictive Polyform Noncommercial license). ClosedXML is a solid free MIT alternative, but its API is low-level and imperative. FluentExcel is a declarative, fluent builder — in the same style as FluentPdf — built on top of ClosedXML, giving you EPPlus-like ergonomics with zero licensing risk, regardless of your company's size or revenue.
Document.Create(workbook =>
{
workbook.Sheet("Orders", sheet =>
{
sheet.Table(orders, table => table
.Column("Order #", o => o.OrderNumber)
.Column("Customer", o => o.CustomerName)
.Column("Total", o => o.Total));
sheet.AutoFitColumns();
});
}).SaveAs("orders.xlsx");dotnet add package Swevo.FluentExcelDocument.Create(...)— top-level entry point; add one or moreSheet(...)calls.sheet.Row(...)— appends one row; eachrow.Cell(...)call writes the next value and returns aCellBuilderfor styling (.Bold(),.Italic(),.Color(...),.Background(...),.NumberFormat(...),.AlignLeft/Center/Right(),.Border(),.WrapText()).sheet.Table(items, table => ...)— declares columns with a header label and a per-row value selector; writes a bold header row plus one row per item. Freezes the header row and adds an auto-filter by default (opt out with.NoFreezeHeader()/.NoAutoFilter()).sheet.EmptyRow(),sheet.FreezeTopRow(),sheet.ColumnWidth(...),sheet.AutoFitColumns()— layout helpers.document.SaveAs(path)/document.ToByteArray()— write to disk or get an in-memory.xlsxbyte array (e.g. to return from an API endpoint).
Document.Create(workbook =>
{
workbook.Sheet("Summary", sheet =>
{
sheet.Row(row => row.Cell("Monthly Report").Bold().FontSize(16));
sheet.EmptyRow();
sheet.Table(lineItems, table => table
.Column("Category", x => x.Category)
.Column("Amount", x => x.Amount));
});
}).SaveAs("report.xlsx");Apply cell-level formatting anywhere via the returned CellBuilder:
row.Cell(total).NumberFormat("$#,##0.00").Bold().AlignRight();
row.Cell(status).Background(status == "Overdue" ? "#FFC7CE" : "#C6EFCE");- MIT licensed, forever. No commercial tier, no revenue threshold.
- Thin layer, solid foundation. All OOXML/file-format complexity is handled by ClosedXML; FluentExcel only adds the declarative builder API on top.
- Familiar if you already use FluentPdf. Same
Document.Create(...)entry point and decorator-style chaining conventions across the Swevo document-generation packages.
- No charts, pivot tables, or conditional formatting yet — use ClosedXML directly for those
(FluentExcel documents are plain
XLWorkbooks under the hood, but they aren't exposed publicly in v1.0). Table(...)always starts at column 1 of the current row; multi-table-per-row layouts require hand-builtRow(...)calls instead.
Contributions and issues for any of the above are welcome.
| Package | Downloads | Description |
|---|---|---|
| Swevo.FluentPdf | A free, MIT-licensed fluent PDF generation library for |
I'm the author of FluentExcel and a suite of compile-time source generators (AutoWire, AutoMap.Generator) and 28+ Polly v8 resilience packages. I'm available for consulting on Polly v8 resilience, Azure cloud architecture, and clean .NET design.
→ solidqualitysolutions.com · LinkedIn
🌐 Full suite overview: swevo.github.io
| Package | Description |
|---|---|
| FluentPdf | Free, MIT-licensed fluent PDF generation — alternative to QuestPDF's revenue-based commercial license. |
| AutoBus | Free, MIT-licensed message bus — alternative to MassTransit's commercial license. |
| EFCore.Outbox | Transactional outbox pattern for EF Core. |
| Swevo.AutoAssert | Free, MIT-licensed fluent assertions — alternative to FluentAssertions' commercial license. |
| EFCore.BulkOperations | Free, MIT-licensed bulk insert/update/delete for EF Core. |
| AutoWire | Compile-time DI auto-registration. |
| AutoDispatch.Generator | Compile-time CQRS dispatcher — free alternative to MediatR's commercial license. |
MIT © Justin Bannister