Skip to content

About

Native OOXML engines in Rust - DOCX, XLSX & PPTX editing, rendering and real-time collaboration, compiled to WASM for the web.

Topics

Resources

Contributing

Security policy

Stars

330 stars

Watchers

2 watching

Forks

Latest commit

 

History

1,856 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BetterOffice: the open-source office suite, built on native OOXML engines in Rust

Rust-native OOXML engines with collaboration and agent editing at the core.
WebAssembly for browsers. Headless APIs for servers. Native Rust where you need it.

license npm downloads: 484,591/month (snapshot 2026-10-27) crates.io downloads: 203,294/month (snapshot 2026-10-27) PyPI downloads: 2,063/month (snapshot 2026-10-27) betteroffice.dev BetterOffice blog

Features

  • Documents, spreadsheets, and slides. Open, edit, render, and save DOCX, XLSX and PPTX files with high fidelity. Native OOXML editing preserves untouched file parts losslessly when round-tripping.

  • Agent editing with human review. Review attributed agent edits through tracked changes, inline diffs, and before-and-after previews. Accept or reject DOCX proposals in the optional proposal sidebar.

  • Real-time collaboration. People and agents edit the same file together, with live cursors and selections. Concurrent changes merge automatically, and offline edits sync when peers reconnect.

  • Undo and redo. Navigate editing history and undo accepted agent proposals as a single step.

  • Embed or automate. Drop React editors into your app, build on the framework-free JavaScript cores, or use Rust and Python APIs for headless processing and agent workflows.

  • Open source and self-hostable. Apache-2.0 licensed, with control over your document storage, deployment, and collaboration infrastructure.

Try it out, or explore the docs for setup, APIs, and format support.

Packages

Rust Core Core (native) React Python
DOCX betteroffice-docx docx docx-native docx-react betteroffice-docx
XLSX betteroffice-xlsx xlsx xlsx-native xlsx-react betteroffice-xlsx
PPTX betteroffice-pptx pptx pptx-native pptx-react betteroffice-pptx

Rust: typed engine API. Core: @betteroffice/<format>, the framework-free core through WebAssembly. Core (native): the same engine as prebuilt native bindings for Node.js, Bun and Deno on macOS, Linux and Windows. React: drop-in editor. Python: read, edit, render, save.

More packages:

What to install for which language, with a first example each: npm, crates.io, PyPI.

Upgrading from 0.4? See Migrating to 0.5.

Fonts

Layout needs the fonts a document names. BetterOffice ships open substitutes with the same advance widths as the Microsoft core fonts (Carlito for Calibri, Caladea for Cambria, Liberation Sans, Serif and Mono for Arial, Times New Roman and Courier New) plus script coverage, so line breaks and pagination match Office without the original fonts installed. DOCX layout resolves a face in this order: fonts embedded in the document, fonts your app configures, the bundled packs, then a last resort fallback.

Pack Covers Size
@betteroffice/fonts-latin Office core families, common presentation families, Hebrew and Arabic 4.6 MB
@betteroffice/fonts-intl 23 more scripts, among them Thai, Devanagari and other Indic scripts, Armenian, Georgian and Ethiopic 2.2 MB
@betteroffice/fonts-cjk Simplified and Traditional Chinese, Japanese, Korean 26.7 MB

Node.js, Bun and Deno. @betteroffice/docx and @betteroffice/pptx depend on the font manager @betteroffice/fonts, which installs fonts-latin. Add fonts-intl or fonts-cjk to cover those scripts. DOCX reads each face from the installed package files the first time a document needs it; nothing is downloaded. Reading package files needs Node.js 20.16 or 22.3 and later, Bun or Deno.

Native bindings, Rust and Python. The Rust format crates bundle all three packs by default and resolve faces in the same order, with nothing fetched; see the Rust guide to leave packs out or load them from your own location. @betteroffice/pptx-native installs the npm packs and reads each face from disk; @betteroffice/docx-native uses the same font manager as @betteroffice/docx. For Python, register the faces a document needs before rendering.

Benchmarks

Generated by the Benchmarks action; per-document results are on the benchmarks site.

Scored against Microsoft Office, BetterOffice vs LibreOffice: DOCX SSIM 0.8519 vs 0.7694, DOCX Exact page counts 63/63 vs 44/63, PPTX SSIM 0.9170 vs 0.9030, XLSX SSIM 0.7661 vs 0.6892, XLSX Recalc accuracy 99.60% vs 85.87%; average time per file, lower is better: DOCX Render time (avg) 430 ms vs 773 ms, PPTX Render time (avg) 159 ms vs 1351 ms, XLSX Recalc time (avg) 64 ms vs 405 ms.
Data

DOCX

Page agreement is reported separately from SSIM.

BetterOffice (3a49caad)LibreOffice (26.2.3.2)
Exact page counts63/6344/63
Absolute page error057
SSIM0.85190.7694
Scored/total63/6363/63
Render time (avg)430 ms773 ms
Parse success100.00%100.00%

PPTX

BetterOffice (3a49caad)LibreOffice (26.2.3.2)
SSIM0.91700.9030
Scored/total103/103103/103
Render time (avg)159 ms1351 ms
Parse success100.00%100.00%

XLSX

BetterOffice (3a49caad)LibreOffice (26.2.3.2)
SSIM0.76610.6892
Scored/total207/208195/208
Recalc accuracy99.60%85.87%
Recalc time (avg)64 ms405 ms
Parse success100.00%100.00%

For how scores, timings and coverage are measured, see the benchmark methodology.

Evals

Model: gpt-6-luna, Harness: codex, three runs per task, on the v3 format eval suite: 96 basic and 33 complex editing tasks on pinned public real-world documents. A run passes only if the requested edit is correct, the rest of the file is untouched, and the input is unchanged.

Agent edit pass rates with gpt-6-luna: basic 91% with BetterOffice MCP vs 61% with generic file tools; complex 82% with BetterOffice MCP vs 36% with generic file tools.
Data

Basic tier: 96 single edits, 32 per format.

Generic file tools BetterOffice MCP
DOCX 43/96 76/96
XLSX 49/96 94/96
PPTX 84/96 92/96

Basic: 262/288 for BetterOffice, 176/288 for generic file tools.

Complex tier: 33 multi-step tasks, 11 per format.

Generic file tools BetterOffice MCP
DOCX 2/33 19/33
XLSX 13/33 31/33
PPTX 21/33 31/33

Complex: 81/99 for BetterOffice, 36/99 for generic file tools.

Generic: shell and Python with python-docx, openpyxl and python-pptx, no network. BetterOffice: only the @betteroffice/agents MCP server.

Per-task results and methodology.

Structure

  • crates/: the Rust engines
  • packages/: the TypeScript editor packages
  • bindings/: the Python bindings
  • e2e/: browser tests, corpus scenarios, and the shared test harness
  • apps/web: betteroffice.dev (Next.js on Cloudflare Workers)
  • apps/demo: editor playground
  • apps/docs: documentation

Development

bun install
bun run dev:demo     # editor playground; builds the wasm bundles on first run
bun run dev          # betteroffice.dev site (no wasm needed)
bun run dev:docs     # documentation site
bun run rust:check   # fmt + clippy + tests for the engines

Run bun run test:e2e:browser for headless browser tests of all three editors. The E2E guide also covers pinned corpus scenarios, cross-SDK checks, and operation profiles.

Use the Office visual quality harness to export Word, PowerPoint, and Excel references, compare local renders, or refresh the fidelity scores with the manual action.

Contributing

Contributions are welcome. We ask for a one-time signature of the Contributor License Agreement on your first pull request (corporate version).

License

Apache-2.0. Third-party attribution in THIRD-PARTY-NOTICES.md.

About

Native OOXML engines in Rust - DOCX, XLSX & PPTX editing, rendering and real-time collaboration, compiled to WASM for the web.

Topics

Resources

Contributing

Security policy

Stars

330 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages