Convert a DOCX File to PDF
Converting a .docx file to PDF renders the document's XML layout instructions — paragraphs, styles, tables, and floating objects — into fixed pages with embedded fonts, so the result looks identical on every device. This page walks through the three reliable ways to do it: Word's built-in exporter, LibreOffice (including a scriptable command line), and Google Docs, and explains why fonts and page breaks sometimes shift in the output.
Rendering a .docx faithfully requires a full word-processing layout engine — line breaking, style inheritance, table layout, field evaluation — which browsers do not expose to web pages. A purely local in-browser conversion would silently mangle real documents, so this page shows the methods that do it reliably instead.
Disclosure: this page contains affiliate placeholder links. If they were live, we could earn a commission at no extra cost to you.
AFFILIATE PLACEHOLDER: Recommended desktop PDF suite (placeholder link)
How to convert a DOCX to PDF (step by step)
Method 1 — Microsoft Word's exporter (best fidelity)
- Open the .docx file in Microsoft Word (2013 or newer for full fidelity).
- Go to File → Export → Create PDF/XPS Document and click Create PDF/XPS. (File → Save As with type "PDF" does the same thing.)
- Click Options to enable bookmarks from headings, document properties, or PDF/A compliance if you need archival output.
- Choose Standard (publishing online and printing) quality, pick a folder, and click Publish.
Word is the reference implementation for .docx layout, so this route gives the closest match to what you see on screen, plus tagged, accessible PDF output when "Document structure tags for accessibility" is ticked.
Method 2 — LibreOffice, interactively or from the command line
LibreOffice Writer opens .docx files and exports via File → Export As → Export as PDF. For batch work, the headless converter handles a whole folder without opening a window:
soffice --headless --convert-to pdf --outdir ./out report.docx
soffice --headless --convert-to pdf --outdir ./out *.docx
Expect near-perfect results on straightforward documents and small differences on documents that lean on Word-specific features (see "How it works" below).
Method 3 — Google Docs (no software installed)
- Upload the .docx to Google Drive and open it with Google Docs.
- Choose File → Download → PDF Document (.pdf).
Convenient, but Google Docs first converts the file into its own model, so headers, footnotes, and multi-column sections are the most likely places to drift. Note this route uploads your document to Google's servers.
How it works
A .docx file is a ZIP archive of XML parts — the OOXML format standardized as ECMA-376 and ISO/IEC 29500. The main part, word/document.xml, contains paragraph and run elements that reference styles, themes, and numbering definitions stored in sibling parts. Crucially, a .docx contains no pages: page breaks do not exist in the file except where typed explicitly. Pagination is computed at open time by the application's layout engine from font metrics, margins, and paragraph rules.
PDF is the opposite kind of format: it stores fixed pages of positioned glyphs and graphics with the fonts (or font subsets) embedded. Conversion therefore means running the full layout pass — resolving the style hierarchy, measuring every line with real font metrics, placing floats and tables — and then serializing each computed page into PDF content streams. That is why the converting application matters: two engines with slightly different line-breaking or table algorithms produce PDFs that differ by a line here and a page break there.
Fonts are the biggest practical failure point. The .docx stores only font names such as "Calibri" or a corporate brand font; if the converting machine lacks one, the engine substitutes a fallback with different advance widths, and text reflows. Word-specific constructs are the second: SmartArt, ink annotations, and some field codes have no exact equivalent in other engines, so LibreOffice renders SmartArt from its embedded fallback image and evaluates fields at conversion time (a DATE field freezes to the conversion date, for example).
Worked example: a 24-page project report
A real test file: a 24-page project report, report-final.docx, 1.9 MB, containing 11 headings styled Heading 1–2, four tables, six embedded PNG screenshots, and 214 hyperlinks in the reference list. Exported from Word 2021 at Standard quality with bookmarks enabled, the output was report-final.pdf, 1.1 MB, still 24 pages — smaller because Word downsampled the screenshots to 220 ppi and embedded only the used subset of each font (Calibri's subset weighed 38 KB against the full 1.6 MB font). All 214 links were clickable and the 11 headings appeared as PDF bookmarks. The same file through soffice --headless --convert-to pdf produced a 1.2 MB PDF that matched page-for-page except one table on page 17, where a 2 pt difference in cell padding pushed a row to the next page — typical of the small engine differences described above.
Frequently asked questions
Why do fonts look different after converting DOCX to PDF?
A .docx stores font names, not the fonts themselves, so any machine missing a font substitutes another one with different letter widths, which reflows lines and page breaks. Convert on a machine that has every font installed, or enable font embedding in Word under File, Options, Save before sharing the .docx.
Do hyperlinks survive the DOCX to PDF conversion?
Yes, Word's exporter and LibreOffice both write clickable link annotations into the PDF for every hyperlink in the document. Printing to a PDF printer driver instead does not, because the print path only sends drawing commands.
Will tracked changes and comments show up in the PDF?
The PDF captures whatever markup view is active when you export, so exporting with All Markup visible prints the revision bars and balloons. Set the review view to No Markup and accept or reject changes first if you want a clean document.
Can I convert a DOCX to PDF without Microsoft Word?
Yes, LibreOffice Writer opens .docx files and exports PDF for free, and the soffice command line converts whole folders unattended. Google Docs also imports .docx and downloads as PDF, though complex layouts render less accurately than in Word.
How do I make a PDF/A archival file from a DOCX?
In Word's export dialog click Options and tick PDF/A compliant; in LibreOffice choose PDF/A in the Export as PDF dialog. PDF/A embeds every font and forbids external dependencies, so the file typically grows by a few hundred kilobytes.
Why is my exported PDF bigger than the DOCX?
A .docx is already a zip archive, while a PDF must embed font subsets and may store images recompressed at higher quality, so text-heavy files can grow. Image-heavy files usually shrink instead because Word downsamples pictures to 220 ppi by default during export.