OpenWord is a professional, high-fidelity, client-side word processor built with React, TypeScript, and Tiptap. It simulates a premium Microsoft Word desktop interface directly in your browser, featuring virtual pagination, dynamic margins, a responsive floating ribbon menu, auto-saving, dark mode support, and a hybrid local AI engine.
- ⚡ Launch the App Live: You can use the fully featured word processor directly in your browser with zero setup: Use OpenWord Live on GitHub Pages.
- 💻 Download & Customize: The project is 100% open-source. You can clone the repository, run it locally, adapt the components, or host it yourself under your own domain.
Unlike standard cloud word processors, OpenWord is an offline-first, zero-server application.
- Privacy-First: Your documents are never uploaded to any external server. All text processing, imports, database updates, and document compilation occur directly in your browser sandbox.
- No Accounts Needed: Start drafting immediately. Your workspace recovers itself automatically on restart using client-side IndexedDB persistence.
- Local AI Execution: Generative AI features run 100% locally on your computer's GPU/CPU (via WebGPU or a local Ollama daemon), meaning your text prompts never leave your device.
- Virtual A4/Letter Pagination: Visual page breaks that automatically calculate paragraph and node heights in real-time, inserting clean page lines exactly like a physical layout.
- Zoom-Scaled Margin Ruler: Drag-and-drop margin handles to adjust left and right margins dynamically. The cursor tracking scales mathematically to match your current document zoom level.
- Dynamic Headers & Footers: Set customized running header and footer text zones that automatically overlay relative to page margins.
- Auto-Collapsing Ribbon: An interactive ribbon toolbar matching Microsoft Word's layout. It collapses into tabs automatically to maximize vertical reading space and slides open on hover.
- Direct Title Bar Renaming: Edit the document filename directly inside the Windows-styled Title Bar input.
- Sidebar Navigation Outline: Auto-updating outline list based on heading tags to navigate large documents quickly.
- Aesthetic Theme Selector: Seamless light-to-dark canvas transition via the bottom Status Bar.
OpenWord hosts a highly advanced local AI client supporting two execution modes:
- Ollama mode (Local Daemon): Connects to a local Ollama instance running on port
11434. Includes automated hardware checking (profiling GPU VRAM to recommend models) and one-click daemon launching. - WebGPU mode (In-Browser): Runs models directly inside your browser tab without any native backend software.
- Hybrid WebGPU Engines:
- Google LiteRT-LM (TFLite): Automatically routes Gemma 4 E2B to Google's official, highly optimized LiteRT runtime. It streams
.litertlmmodel weights, caches them in Cache Storage for instant startup, and utilizes optimized shaders to prevent browser OOM crashes. - WebWorker MLC Engine: Runs Llama 3.2 1B, Gemma 2 2B, Qwen, and Phi models off the main thread.
- Google LiteRT-LM (TFLite): Automatically routes Gemma 4 E2B to Google's official, highly optimized LiteRT runtime. It streams
- Web Worker Offloading: Moving 100% of WebGPU execution, model compilation, and downloading to a background thread to keep the user interface fully responsive at 60fps.
- Mobile memory safeguards: Automatically detects mobile user agents to cap context windows to
1024tokens and sliding windows to-1to avoid VRAM exhaustion crashes. Includes warnings for high-memory models. - Ollama Fallback Switcher: If Ollama is offline or the user lacks VRAM (under 3GB), the UI suggests switching to WebGPU mode to run lighter models (Llama 3.2 1B) in-browser.
- Dual Document-Editing Modes:
- Direct Edit Mode (Real-Time): Streams AI edits directly into the document editor in real-time.
- Proposal Mode (Visual Diff): Streams changes to a sidebar visual diff card (rendered with green/red additions/deletions), allowing you to review edits and click Accept & Apply or Reject before mutating the document.
- Robust XML Tool Actions: Parses structural document actions (
<edit_block>,<insert_block>,<delete_block>) dynamically, supporting arbitrary attribute order, spacing, and quote styles.
- IndexedDB Autosave: Background saving to IndexedDB (v2) with an automatic session recovery dialog on startup.
- Zero-Server Exports: Export documents directly to Microsoft Word
.docxformat using client-side XML packaging. - Mammoth HTML Importer: Import local document formats directly into the editor canvas.
OpenWord separates UI rendering from document state and heavy AI workloads using Web Workers and Service Caches:
+--------------------------------+
| Tiptap/ProseMirror |
+--------------------------------+
|
(onUpdate Event / JSON)
v
+--------------------------------+
| React DocumentContext State |
+--------------------------------+
/ | \
/ | \
(Debounced 5s) / | (150ms Break) \ (Chat Prompts)
v v v
+---------------+ +---------------+ +--------------------------+
| IndexedDB | | Pagination | | AI Switcher Controller |
| Storage | | Extension | | (webllm.ts helper) |
+---------------+ +---------------+ +--------------------------+
/ \
(Provider: 'webllm') (Provider: 'litert')
/ \
v v
+-----------------------+ +--------------------+
| WebWorker MLC Engine | | Google LiteRT-LM |
| (WASM Background) | | (Object URL) |
+-----------------------+ +--------------------+
| |
v v
[Cache Storage] [Cache Storage]
(webllm-cache) (litert-lm-cache)
├── public/ # Static assets (Favicons, screenshots)
├── src/
│ ├── assets/ # Brand logos and SVGs
│ ├── components/ # Workspace UI layout blocks
│ │ ├── Editor/ # Custom extensions and pagination logic
│ │ ├── Ribbon/ # Toolbar operations (Font, spacing, view)
│ │ ├── Ruler/ # Interactive margin ruler
│ │ ├── Sidebar/ # Outline & local AI Copilot panel
│ │ └── StatusBar/ # Page counter, layout toggles, theme switcher
│ ├── context/ # Global Document layout & editing state
│ ├── styles/ # Harmony CSS variables & dark theme tokens
│ ├── utils/ # Exporters, DB helpers, Web Worker handlers, LiteRT-LM wrappers
│ ├── App.tsx # Application shell
│ └── main.tsx # App bootstrapping
├── package.json # Deployment scripts and dependencies
└── vite.config.ts # Vite build config & subpath routing
Make sure you have Node.js installed.
-
Clone the repository:
git clone https://github.com/RorriMaesu/OpenWord.git cd OpenWord -
Install dependencies:
npm install
-
Start local development server:
npm run dev
Open
http://localhost:5173in your browser.
npm run buildThis generates a static website inside the dist/ directory.
npm run deployThis builds the application and deploys the static files to your repository's gh-pages branch.
- Custom margin presets (Narrow, Moderate, Wide).
- Full Page-Break rendering inside document export (
.docxparser compatibility). - Custom page dimensions selector (Letter, Legal, Executive, A4).
- Advanced keyboard shortcuts helper card.
This project is licensed under the MIT License - see the LICENSE file for details.

