Skip to content

Latest commit

 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DOCX Viewer

A fast, mobile-first, single-file Word document viewer. Drag & drop a .docx and read it in your browser — headings, tables, lists, and images rendered with formatting intact. It's a viewer, not an editor — no toolbars, no accounts, no uploads. Everything runs locally in your browser.

🔗 Live: https://docx-viewer.us/

Single file No build step License

Part of the File Viewer family — HTML, Markdown, ePUB, PDF, Data, DOCX, and Sheets each have their own dedicated viewer. Use the ☰ menu in the header to jump between them.

Features

  • 📄 Faithful rendering — headings, paragraphs, bold/italic runs, tables, lists, and inline images render with their document formatting.
  • 🖼️ Images inline — embedded pictures are decoded locally and shown in place; nothing is fetched from the network.
  • 🔀 Drop to replace — drop a new document while one is open and it replaces the current view.
  • 🧭 Legacy notice — older/binary formats (.doc, .rtf, .odt) that have no reliable in-browser renderer get a clear "Save As → .docx" note instead of a broken page.
  • ☰ Family menu — a hamburger flyout links to every viewer.
  • 🫥 Distraction-free header — auto-hides while you read, collapsing to a thin handle; hover, tap, or scroll up to bring it back.
  • 🎨 Pick any background color — remembered across visits.
  • 🪶 One file, no build — index.html is self-contained and works offline, even from file://.
  • 📊 Privacy-friendly analytics — self-hosted, cookieless Plausible; your files never leave your device.

Supported file types

Rendered in full: .docx .docm .dotx .dotm

Accepted with a notice (no reliable in-browser renderer — open in Word or LibreOffice and use Save As → .docx): .doc .dot .rtf .odt

Quick start

Just open it. Download index.html, double-click it — no server, no build, no internet needed.

python3 -m http.server 8080   # then open http://localhost:8080

Deploy to Cloudflare Pages

Connect the repo (Workers & Pages → Create → Pages → Connect to Git), framework preset None, build command blank, output directory /. The _headers file applies a strict CSP automatically. Add the custom domain docx-viewer.us under the project's Custom domains tab.

How it works

Everything is in index.html — app logic plus two inline libraries, so rendering works offline:

  • docx-preview v0.3.3 (Apache-2.0) — renders Office Open XML (.docx) into HTML.
  • JSZip v3.10.1 (MIT) — unzips the .docx package (a .docx is a ZIP of XML parts) in the browser.

Images are inlined as data: URLs (useBase64URL), so the viewer's CSP stays strict (default-src 'none', no external assets, no blob:).

Note: this is a viewer — it shows content + layout. Some advanced Word features (tracked-change markup, comments, complex field codes, macros) are not rendered; content controls show their current values.

Credits

Component Version License
docx-preview 0.3.3 Apache-2.0
JSZip 3.10.1 MIT
pako (bundled in JSZip) 1.0.x MIT
JetBrains Mono (subset, headings) — SIL OFL-1.1

The file-type icon (favicon and header icon) is from vscode-icons (MIT). Analytics by Plausible.

License

MIT © 2026 Michal Ferber, aka TechGuyWithABeard. Bundled components retain their own licenses — see LICENSE and Credits.

About

Single-file Word (.docx) viewer — formatting, styles, tables & images. No build, offline, private.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages