docx-editor
Free Open-Source Document Editor

AI Agent-driven WYSIWYG document editor that directly uses the Word-native Office Open XML (OOXML) specification as its data model, parsing and handling Word documents with zero formatting loss.

Core Features & Advantages

AI Agent Driven

Deeply integrated AI assistance supporting context-aware writing, auto-completion, smart grammar polishing, outline summarizing, and structured document auto-generation to double your productivity.

Native OOXML Data Model

No lossy "Word -> HTML -> Word" conversions. We parse and manipulate the Office Open XML specification directly, mapping 100% of Word's underlying document structure with zero style loss.

100% Client-Side Execution

Runs completely on the client side with no complex or expensive backend rendering servers. Provides excellent load response times and offline capability while protecting data privacy.

Professional Document Editing

Ultimate WYSIWYG experience. Supports track changes, document comments with replies, complex tables and rich formatting layouts, image insertion, and more.

Open Source & Commercial Friendly

Completely free under the permissive Apache 2.0 license. Perfectly suited for commercial use, with no copyleft requirements even if you modify the editor code.

Extensible Plugin Architecture

Clean, loosely coupled plugin architecture that empowers developers to customize toolbars, extend editor commands, and intercept core events for deep secondary development.

Typical Scenarios

01

Proprietary AI Document Editor

With client-side execution and customizable APIs, businesses can build proprietary AI co-writing systems. Seamlessly connect to self-hosted or domain-specific LLMs without relying on third-party cloud services to ensure data privacy.

02

Deep Integration with Knowledge Bases (RAG)

Integrate with internal knowledge bases, legal/regulatory databases, and custom glossaries to enable real-time semantic search as you edit. Get AI assistance for proofreading, compliance checks, and term referencing.

03

High-Value Commercial Document Editing

Crucial for drafting and proofreading contracts in legal, financial, and government sectors. With 100% loss-free OOXML rendering, AI can identify loopholes and risky terms, shortening review cycles and reducing operational risks.

TECHNICAL SELECTION

Why is it the best choice for proprietary AI editors?

When choosing a document editor for your AI project, technology selection is critical. Thanks to its unique architecture, docx-editor solves the challenges of development efficiency, compatibility, and intelligence depth.

Ultra-Agile: Fast Delivery & Launch

Out-of-the-box modular design with official React and Vue 3 adapters. Integrate robust Word editing and AI collaboration in days without wrestling with lower-level rendering engines.

Cross-Platform: Multi-Client Integration

Built on standard web technologies. Write once and integrate into PC/mobile web pages (with touch gesture interactions) or package via WebView/Electron for mobile apps and desktop clients.

Word Compatibility: Seamless User Onboarding

Uses standard DOCX binary format. Painless transition for administration, legal, and marketing personnel, maintaining format compatibility with MS Word and avoiding layout issues caused by HTML conversion.

Deep AI Integration: Fine-Grained Text Manipulation

Break past simple "plaintext AI chatbox" limitations. The AI assistant can use APIs to manipulate rich text styles, bullet levels, table merges, and paragraph indents for true semantic editing.

REAL-TIME COLLABORATION

Millisecond-Level Real-Time Collaboration

docx-editor natively integrates Yjs (CRDT collaborative data model), supporting real-time multi-user editing of the same Word document with instant state synchronization:

  • Real-time cursor highlights showing other users' editing paths
  • CRDT-based conflict resolution with no locking, enabling offline edits and merging
  • Flexible collaborative connectors for WebSockets, WebRTC, or custom gateways
User AUser B
SERVER-SIDE HEADLESS

Headless DOM-Free Rendering & Processing

The engine's core is decoupled from the UI view. This enables efficient Word file operations in non-browser environments like Node.js or CLI:

  • Batch inject variables, fill templates, and generate automated reports server-side
  • Extremely fast, running without headless browser setups like Puppeteer or JSDOM
  • Supports rapid document pre-rendering from CLI or backend servers via plugins
$ npm run compile-reportLoading docx template [success]Injecting dataset variables... (124 fields)Output saved to ./report_2026.docx

Comparison with Similar Open-Source Libraries

We understand the care taken when making open-source choices. Here is how docx-editor stacks up against the similar editor SuperDoc:

Comparison Dimension docx-editor SuperDoc
License (Commercial Gateway) Apache 2.0 (Permissive)

Completely free for commercial use. Even if you modify the source code, there is no copyleft requirement for your business logic—zero license risks or costs.

AGPL 3.0 (Copyleft)

Using the service over a network forces you to open-source your entire business system code. Closed-source use requires expensive commercial licensing.

CJK (Chinese/Japanese/Korean) Input Support Fully Optimised CJK IME Support

Deep event intercepting and composition optimisation for keyboard IMEs, ensuring smooth typing with no leftover pinyin or cursor jumping.

Poor UX (Critical Bugs)

Poor Composition event handling often results in duplicate/corrupt text, leftover pinyin, and cursor glitches during CJK keyboard input.

Core Completeness & Stability Highly Mature

Native Yjs conflict resolution, complete decoupling of core and UI, and field-tested in complex production environments for solid stability.

In Active Development

Some advanced rich text formatting options remain experimental, and offline merge stability requires further testing.

Quick Integration

1. Install React adapter package & dependencies

# Install the latest stable React dependency for docx-editor
npm install @eigenpal/docx-editor-react

2. Import and configure in your component

import React, { useState } from 'react';
import { DocxEditor } from '@eigenpal/docx-editor-react';
// Import styles for correct toolbar and editor rendering
import '@eigenpal/docx-editor-react/styles.css';

function DocumentWorkspace() {
  const [docBuffer, setDocBuffer] = useState(null);

  const handleSave = (updatedBuffer) => {
    // updatedBuffer is the modified Word native binary data (ArrayBuffer)
    console.log('Document data updated:', updatedBuffer);
  };

  return (
    <div style={{ height: '80vh', border: '1px solid rgba(255,255,255,0.08)' }}>
      <DocxEditor
        documentBuffer={docBuffer}
        onSave={handleSave}
      />
      </div>
  );
}

export default DocumentWorkspace;

1. Install Vue 3 adapter package & dependencies

# Install the wrapper package designed for Vue 3
npm install @eigenpal/docx-editor-vue

2. Create Vue editor component

<template>
  <div class="editor-container">
    <DocxEditor
      :documentBuffer="docBuffer"
      @save="handleSave"
    />
  </div>
</template>

<script setup>
import { ref } from 'vue';
import { DocxEditor } from '@eigenpal/docx-editor-vue';
// Import the stylesheet to render the editor interface properly
import '@eigenpal/docx-editor-vue/styles.css';

const docBuffer = ref(null);

const handleSave = (updatedBuffer) => {
  // Capture the latest .docx ArrayBuffer data to submit/save
  console.log('Vue received document update:', updatedBuffer);
};
</script>

<style scoped>
.editor-container {
  height: 80vh;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
</style>