# dom-docx > Convert semantic HTML to native, editable Word documents (.docx) in the browser or Node.js. Open-source OOXML, MIT licensed. Produces real paragraphs, runs, lists and tables rather than screenshots or layout hacks. On a public benchmark of 50 test cases, each converted document is rendered and scored against the browser's rendering of the same HTML. dom-docx 96.6 mean layout fidelity, against html-to-docx 64.7, @turbodocx/html-to-docx 65.6. Method and per-case scores are on the compare page. Install with `npm install dom-docx`. The package ships an AGENTS.md written for AI agents that need to produce Word documents: it lists which HTML constructs convert well, which to avoid, and copyable document shapes. ```js import { convertHtmlToDocx } from "dom-docx"; const docx = await convertHtmlToDocx("
Body
"); ``` ## Pages - [dom-docx — HTML to Word converter in the browser](https://dom-docx.com/): Convert HTML to native, editable Word documents (.docx) in your browser. Open-source OOXML — tables, lists, stylesheets, no upload required. - [HTML to DOCX examples — dom-docx](https://dom-docx.com/examples): Sample HTML documents converted to Word: invoices, financial statements, contracts, dashboards, and essays. Preview DOCX output from dom-docx. - [HTML to DOCX converters compared — dom-docx](https://dom-docx.com/compare): A reproducible benchmark of HTML to DOCX converters. Layout fidelity, editability and conversion speed, scored on identical test cases with the method public. - [Learn dom-docx — code examples](https://dom-docx.com/learn): Install and integrate dom-docx: browser and Node.js examples, computed styles, image resolver, page breaks, mixed orientation, page-number fields, and document metadata. - [Brute forcing my way to better HTML → DOCX conversion — dom-docx](https://dom-docx.com/story): The origin story of dom-docx: using autoresearch loops to brute-force a higher-fidelity HTML-to-DOCX converter. 40+ real-world test cases, scored and ground down one edge case at a time. - [Try HTML to Word converter — dom-docx](https://dom-docx.com/try): Paste HTML and download a .docx file instantly. Free in-browser HTML to Word conversion — client-side, nothing uploaded. ## Source - [GitHub repository](https://github.com/floodtide/dom-docx): source, AGENTS.md, API.md, and the benchmark harness - [npm package](https://www.npmjs.com/package/dom-docx): `npm install dom-docx`