HTML PDF Swap
HTML to PDF
Converting…
Choose a HTML file
.html, .htm, .xhtml
Convert
Download
HTML pivot preview
FAQ and format details
Why convert HTML to PDF?
Use HTML→PDF when someone asked for 'a PDF of this page' and you do not want to File→Print→Save as PDF on a machine whose print driver will rewrite fonts. Typical jobs: a snapshot of a policy HTML file, an offline copy of a Markdown preview, or a simple invoice-like article.
How this conversion runs
The HTML hub is walked into blocks. pdf-lib draws each heading and paragraph, wrapping lines to the page width and adding pages when the cursor runs out of room. Western punctuation is normalized to WinAnsi; characters the built-in fonts cannot paint become question marks, with a warning. Images currently become alt-text lines rather than embedded bitmaps.
Keep in mind for HTML → PDF
This is not Chrome's print engine. Headers, footers, page numbers, and CSS @media print rules are not honored. Multi-column layouts become a single column. For a layout-faithful PDF, open the HTML locally and use the browser's print dialog — that path is still the highest fidelity, and this converter tells you so in the warnings.
After you have a PDF file
Open the PDF in Acrobat, Preview, or the browser. If type looks wrong (CJK, Arabic, emoji), you hit the standard-font limit; stay in HTML or print from a browser that can embed fonts. If you needed comments and reflow, you wanted HTML→DOCX instead.
Can I choose A4?
Not yet. Pages are US Letter (612×792 points). If you need A4, print the HTML from the browser and pick A4 in the print dialog.
Will links stay clickable?
Link text is drawn; clickable PDF annotations are not written in this version. Keep the HTML if you need a web of URLs.
This pair at a glance
- Accepts
- .html, .htm, .xhtml
- Writes
- .pdf · application/pdf
- Read fidelity
- exact (HTML → HTML)
- Write fidelity
- medium (HTML → PDF)
- Source size
- Plan for files under 7.6 MB
Runs in this browser.
Something off with this pair? Send feedback.
About HTML and PDF
Source file
HTML
The web’s native document format: structured markup for headings, paragraphs, lists, tables, links, and media.
HTML is the pivot format for this converter. Incoming files are turned into a sanitized HTML document, and outgoing files are generated from that document. Browsers, email clients, and most rich-text editors already speak it, which is why it is the most flexible interchange point.
- Extensions
- .html, .htm, .xhtml
- MIME types
- text/html, application/xhtml+xml
- Kind
- text · utf-8
- Category
- markup
- Standard
- Open format · since 1993
- Spec
- HTML Living Standard
- Comfortable size
- Up to about 7.6 MB in this browser converter
- Read into HTML
- exact fidelity · implemented — Identity transform after sanitizing script/style that cannot round-trip into other document types.
What this format can hold
- headings
- paragraphs
- lists
- tables
- links
- images
- inline formatting
- semantic structure
Apps that consume HTML
- Chrome (Google) — opens on Windows, macOS, Linux, Android
- Firefox (Mozilla) — opens on Windows, macOS, Linux, Android
- Safari (Apple) — opens on macOS, iOS
- Edge (Microsoft) — opens on Windows, macOS
- VS Code (Microsoft) — creates on Windows, macOS, Linux
- WordPress — creates and opens on Web
Catalog notes
Destination file
A page-description format that paints glyphs and graphics onto fixed pages. Universal for print, archival, and sharing.
PDF (Portable Document Format) describes pages, not a flowing document tree. Incoming PDFs are reconstructed as HTML: designed pages keep positioned text, fonts, images, and vectors; simpler reading documents become flowing articles. Export to PDF paints HTML onto pages via pdf-lib. Pixel-perfect Word/InDesign layout is not the goal.
- Extensions
- MIME types
- application/pdf
- Kind
- binary · binary
- Category
- page description
- Standard
- Open format · since 1993
- Spec
- ISO 32000
- Comfortable size
- Up to about 38 MB in this browser converter
- Written from HTML
- medium fidelity · implemented — HTML is paginated onto US Letter pages via pdf-lib. Embedded PNG/JPEG data URLs are painted. Print-to-PDF from the preview remains the highest-fidelity path.
What this format can hold
- page layout
- paragraphs
- images
- links
- embedded fonts
Usually dropped on the way out
- css absolute layout
- webfonts unless embedded
- interactive forms
Apps that consume PDF
- Adobe Acrobat / Reader (Adobe) — creates and opens on Windows, macOS, iOS, Android
- Chrome (Google) — opens on Windows, macOS, Linux, Android
- Edge (Microsoft) — opens on Windows, macOS
- Preview (Apple) — opens on macOS, iOS
- Foxit — creates and opens on Windows, macOS
- Okular (KDE) — opens on Linux
Catalog notes
Other conversions
Other conversions from HTML: MarkdownWordRTFOpenDocumentEPUB
Other ways to get PDF: MarkdownWordRTFOpenDocumentEPUB