HTML to DOCX converters, measured
A benchmark of the maintained HTML to DOCX libraries on npm, scored on identical test cases. The scoring harness lives in the dom-docx repository and the run is reproducible.
Scoring methodology
Each test case is an HTML fragment. It is rendered in Chromium through Playwright and captured as an image. The same fragment is converted to DOCX by each library, rendered through LibreOffice and captured again. The two images are then compared.
Every library receives identical input. dom-docx runs in its default mode, parsing the markup it is given. The browser produces reference images only and takes no part in any conversion.
Each case produces three scores, which are weighted into a composite.
- Layout fidelity 50%
- Editability 35%
- Conversion speed 15%
High-level Results
| Axis | dom-docx0.1.21 | html-to-docx1.8.0 | @turbodocx/html-to-docx1.22.0 |
|---|---|---|---|
| Layout fidelityConverted output rendered and compared against the browser's rendering of the same HTML. Weighted 50% of the composite. | 96.6 | 64.7 | 65.6 |
| EditabilityWhether the result is real Word content you can edit, not a picture of one. Weighted 35%. | 99.2 | 100.0 | 100.0 |
| Avg. compile timeMean conversion time per case. Scored on the curve described above and weighted 15% of the composite. | 39.6ms | 10.9ms | 13.8ms |
| CompositeThe three axes above, weighted. | 95.8 | 82.2 | 82.5 |
Capabilities
Scores only cover what can be measured on the same input. These are the structural differences, checked against package metadata and each project's own documentation.
| Capability | dom-docx0.1.21 | @turbodocx/html-to-docx1.22.0 | html-to-docx1.8.0 |
|---|---|---|---|
| Runs in the browser | Yes | Yes | No |
| Command line | Yes | No | No |
| Style source | Parsed markup by default, computed styles optional | Parsed markup | Parsed markup |
- dom-docx. Browser support via the ./browser subpath export; CLI via the dom-docx bin
Full list of test cases
| Test case | dom-docx | html-to-docx | @turbodocx/html-to-docx |
|---|---|---|---|
inline-svg-chart |
97.0 | 7.2 | 9.8 |
nested-blockquotes-lists |
91.5 | 12.1 | 11.5 |
rasterize-in-place-chart |
99.2 | 24.5 | 26.0 |
image-figure |
99.3 | 29.3 | 30.5 |
admonition-note |
98.0 | 33.3 | 33.6 |
flex-column-vertical |
98.2 | 38.6 | 37.5 |
tooltip-skipped |
97.1 | 39.1 | 38.4 |
typography-colors |
90.3 | 26.5 | 35.9 |
table-colgroup-widths |
97.6 | 47.3 | 44.7 |
borderless-table |
97.0 | 39.1 | 49.5 |
flex-row-horizontal |
97.3 | 51.9 | 46.4 |
table-physical-unit-widths |
97.5 | 53.0 | 49.9 |
flex-row-images |
96.8 | 53.3 | 50.8 |
adjacent-tables |
96.9 | 57.2 | 54.7 |
inline-vs-block |
98.3 | 60.3 | 55.5 |
css-length-units |
97.0 | 55.6 | 59.1 |
table-vertical-text |
82.5 | 45.2 | 45.0 |
table-mismatched-cells |
97.3 | 60.6 | 57.2 |
simple-table-2x2 |
97.0 | 62.0 | 58.0 |
table-cell-padding |
97.2 | 62.8 | 61.6 |
bordered-shaded-div-width-percent |
97.4 | 63.8 | 63.8 |
mixed-margins-paddings |
95.7 | 52.8 | 62.1 |
simple-table-3col |
97.5 | 64.1 | 59.3 |
table-row-backgrounds |
98.7 | 29.8 | 72.2 |
modal-dialog-skipped |
95.2 | 71.9 | 45.5 |
basic-inline-formatting |
97.4 | 74.6 | 71.8 |
horizontal-rule |
94.6 | 66.1 | 72.3 |
simple-unordered-list |
97.3 | 77.2 | 70.0 |
pre-code-block |
97.2 | 74.8 | 77.4 |
heading-hierarchy |
97.2 | 75.3 | 78.3 |
unicode-emoji-content |
96.4 | 49.0 | 77.7 |
table-empty-cell-row-height |
91.6 | 78.3 | 78.0 |
paragraph-and-list |
97.0 | 84.1 | 72.6 |
unordered-list-square |
96.9 | 86.7 | 69.2 |
table-cell-bar-divs |
98.7 | 43.6 | 89.3 |
ordered-list-rich-inline |
97.9 | 90.7 | 94.0 |
ordered-list-upper-roman |
97.1 | 93.4 | 70.0 |
simple-blockquote |
97.4 | 93.9 | 93.8 |
ordered-list-lower-alpha |
97.3 | 94.3 | 70.0 |
simple-ordered-list |
97.2 | 95.3 | 93.3 |
inline-backgrounds |
97.8 | 83.7 | 96.7 |
vertical-align-super-sub |
97.4 | 91.0 | 96.7 |
image-block |
98.8 | 98.1 | 74.2 |
line-height-presets |
97.3 | 87.0 | 96.7 |
multiple-paragraphs |
97.3 | 93.4 | 96.9 |
multiple-links |
96.6 | 86.2 | 96.5 |
simple-link |
96.5 | 96.6 | 96.6 |
plain-paragraph |
96.8 | 97.0 | 97.0 |
centered-paragraph |
96.8 | 97.0 | 97.0 |
paragraph-with-line-break |
96.3 | 86.9 | 96.7 |
Run it yourself
The result above is only worth as much as your ability to check it. Everything needed to reproduce it is in the repo.
git clone https://github.com/floodtide/dom-docx
cd dom-docx
npm install
npm run score:suite
npm run score:benchmark
Scoring renders documents through LibreOffice and Chromium, so results may vary slightly by machine and font availability. If you get materially different numbers, please submit an issue.
Measured 2026-07-25 on 50 cases against dom-docx@0.1.21, html-to-docx@1.8.0, @turbodocx/html-to-docx@1.22.0.