Use it in your application
Available as TypeScript and Python packages.
npm install @docx-editor.dev/docx-to-markdown @docx-editor.dev/coreAdd the converter to your TypeScript or JavaScript application. Includes the required core dependency.
Layout-aware, paged Markdown conversion for document agents and RAG.
Open-source libraryAvailable as TypeScript and Python packages.
npm install @docx-editor.dev/docx-to-markdown @docx-editor.dev/coreAdd the converter to your TypeScript or JavaScript application. Includes the required core dependency.
TypeScript and Python packages powered by our own DOCX layout engine. Run in Node.js, browsers, or Python. Get Markdown, images, and per-page metadata in one call.
npm install @docx-editor.dev/docx-to-markdown @docx-editor.dev/coreimport { readFile } from 'node:fs/promises';
import { exportMarkdown } from '@docx-editor.dev/docx-to-markdown';
const bytes = await readFile('document.docx');
const result = await exportMarkdown(bytes, { images: true });
console.log(result.markdown);
for (const page of result.pages) {
console.log(page.number, page.markdown);
}Process DOCX files in a Node.js application or serverless function. Bundle the required fonts and WebAssembly assets. Microsoft Word and a hosted conversion service are not required.
Convert files in a Next.js function ↗Convert files directly in a TypeScript application. Keep document bytes in the browser and return Markdown, page data, and images using the same API.
Set up browser conversion ↗Send a document. Get Markdown and page JSON. Works with n8n, scripts, and your app.
DOCX to Markdown API
Generating a private trial key for this browser.
Our own DOCX engine calculates the layout before exporting Markdown. You get page context, headers and footers, and image dimensions from the same engine that powers DOCX Editor ↗. Built and maintained by our team, from layout to export.
result.pagesAssociate extracted text with its source page for search results and RAG citations. Read headers and footers separately from the document body.
Work with pages ↗result.mediaExport image files alongside Markdown, with paths and page occurrences. Use HTML image tags when you need displayed width and height. Download both in a ZIP.
Export images ↗result.reviewArtifactsChoose original, proposed, or marked-up text. Read comments and revisions as structured data to build document review and ingestion workflows.
Explore the API ↗Open a .docx file in the converter above. Compare the Word document with the Markdown preview, then copy the output or download it. For conversion in your application, pass the file bytes to exportMarkdown().
Yes. The library is open source under Apache 2.0, including image, comment, and tracked-change extraction. Bundled fonts retain their own licenses. The interactive editor demo includes separately licensed Pro review controls.
Yes. The npm package includes TypeScript declarations and supports JavaScript imports in Node.js and browsers. The docx-to-markdown package on PyPI provides the same converter for Python 3.11 or later.
Use a Node.js runtime with WebAssembly support and include the required font and WASM files in the function bundle. Set memory, upload-size, and execution limits for your workload. Next.js Edge is not supported.
The demo processes document bytes in your browser. No document upload is required for conversion. Fonts and WebAssembly assets must be available to the browser; fallback fonts can require network requests.
Markdown preserves document structure, not every visual detail. The layout engine calculates pages before export, so you can associate text and images with a page. Fonts and document features can change page breaks compared with Microsoft Word. Floating text wrapping, image cropping, and rotation are not reproduced in Markdown.
Fonts determine text widths and page breaks, even though Markdown does not retain font styling. The package includes substitutes for common Word fonts. Use fonts to supply the document’s original faces before those substitutes, and fallbackFonts for additional sources afterward. Check result.fontResolution and result.warnings to see what was used. For repeatable pagination, keep the font files and package versions fixed. Configure fonts and fallbacks ↗
The library accepts .docx files. Save a legacy .doc file as .docx in Word or another compatible editor before converting it.