How to use it
- Choose a .docx file or drop it on the box. It is read in your browser; nothing is uploaded.
- Check the summary: page size, margins, sections, header and footer, page numbers and fonts. If a font is not on your device, the summary says which one is used instead.
- Press Save as PDF. Your browser’s print window opens with the document laid out as pages. Choose Save as PDF as the destination (on iPhone and iPad, tap the share button and then Save to Files), leave margins at Default and scale at 100%, and turn off “Headers and footers” if your browser offers it, so it does not add the date and web address.
How the conversion works
The .docx file is a zip of XML parts. The open-source docx-preview library reads them and lays the document out as web content: paragraphs, runs, styles, lists, tables, images, footnotes, headers and footers. The PDF is then made by your browser’s own print engine, so the text in it is real, selectable and searchable text with the fonts embedded, not a picture of the page.
Laying a Word document out as pages needs more than the library provides, so this tool adds the page layer itself. Each Word section becomes a CSS named page with the document’s page size and margins; the top and bottom margins repeat on every page; the header and footer repeat on every page; and the page-number fields in a footer (PAGE and NUMPAGES, the “Page 3 of 12” kind) become CSS page counters, so they print the real page numbers. Left alone, the library drops a simple PAGE field and prints a NUMPAGES field with whatever number Word last saved.
It also reads three things from the document’s styles that the library ignores: “keep with next” (so a heading is not left alone at the bottom of a page), “keep lines together” and “page break before”, plus the setting that removes the space between list items of the same style.
Why line spacing needed fixing
Word’s “Multiple” line spacing (1.15 is the usual default) multiplies the font’s own single-line height, which for most fonts is taller than the font size. CSS multiplies the font size. On our test file set in 11 pt Cambria at 1.15, LibreOffice placed lines 14.5 pt apart, while a plain CSS layout put them 12.65 pt apart: 13% tighter, enough to fit several extra lines on every page and change where pages break. The tool measures each font’s natural line height in your browser and scales the spacing by it; on the same page our lines now alternate between 14.25 and 15 pt (whole screen pixels), averaging 14.5 pt.
Fonts
A PDF can only contain fonts your device has. Calibri (Word’s default font from 2007 until Microsoft began moving Microsoft 365 to Aptos in July 2023) and Cambria are on Windows and on Macs with Office, but not on iPhones, Android phones or Linux. When they are missing, the tool uses Carlito and Caladea, open-licensed fonts made to have the same character widths as Calibri and Cambria, so lines and pages break in the same places. Aptos has no free look-alike; it and other missing fonts are replaced with a similar serif, sans-serif or monospaced font, and the summary warns that breaks may move. For a PDF that matches Word exactly, convert on the computer the document was written on.
What we tested
On October 15, 2026, in Chromium 141.0.7390.37, we opened each test document in this page, pressed Save as PDF and captured the print output. Each PDF was checked against the .docx read independently with python-docx, and against LibreOffice’s own PDF of the same file:
| Test document | Pages (ours / LibreOffice) | Body words in the PDF, in order | Words outside the margins |
|---|---|---|---|
| Report, Letter, header, footer, lists, table, image | 5 / 5 | 1,802 of 1,802 | 0 |
| A4, manual page breaks | 3 / 3 | 552 of 552 | 0 |
| Portrait then landscape section | 2 / 2 | 100 of 100 | 0 |
| Five fonts, accents, Greek, Cyrillic | 1 / 1 | 70 of 70 | 0 |
| “Page X of Y” footer, different first page | 5 / 5 | 1,802 of 1,802 | 0 |
| Same file saved by LibreOffice | 5 / 5 | 1,802 of 1,802 | 0 |
Page sizes matched the document on every page, including the switch to landscape. The repeating header and footer were on every page, page 1 of the different-first-page file carried its own header and no page number, and pages 2 to 5 read “Page 2 of 5” to “Page 5 of 5”, centered within 0.01 pt of the text column. The file saved by LibreOffice broke onto new pages at exactly the same lines as LibreOffice’s PDF on all five pages.
We also ran the ten test documents of the docx-preview project (3 saved by Microsoft Word, the rest by LibreOffice: equations, footnotes, first, even and odd headers, numbering styles, page layout, tables, breaks, text effects, underlines). Across all 16 documents the page count equalled LibreOffice’s 16 times out of 16, no body word was missing (0 of 6,649), and nothing ran outside the side margins. Old .doc files and non-Word files were refused with a message, and the page worked at 390 px wide with no errors.
What it cannot do
- Repeating headers, footers and page numbers need Chrome or Edge 131 or later, which support CSS page-margin boxes and margins repeated on every page. Safari and Firefox print the body with the right page size and margins, but the header prints once at the start of each section and page numbers are left out; the tool says so before you print.
- Even-page headers and footers use the odd-page version. Footnotes print at the end of their section, not at the bottom of the page where they are referenced.
- Text boxes, shapes, SmartArt, charts and comments are not drawn. Tracked changes print as if accepted, without change marks.
- Page breaks follow from the fonts on your device, so on a device without the document’s fonts they can fall a few lines away from Word’s.
- Old .doc files and password-protected documents cannot be read in a browser; save them as .docx first.
Sources
Checked on .
- docx-preview (docxjs), Volodymyr Baydalka, Apache-2.0
- W3C: CSS Paged Media Module Level 3 (named pages, page-margin boxes, page counters)
- W3C: CSS Fragmentation Module Level 3 (box-decoration-break)
- MDN Web Docs: @page (page-margin boxes, browser support)
- MDN Web Docs: box-decoration-break (browser support)
- Carlito font project: metric-compatible with Calibri (OFL 1.1)
- Debian package fonts-crosextra-caladea: serif font metric-compatible with Cambria
- Microsoft Design: A change of typeface, Microsoft’s new default font has arrived (Aptos, July 2023)
- Ecma International: ECMA-376 Office Open XML File Formats
Frequently Asked Questions
Built by Derek Giordano · Part of Ultimate Design Tools