HTML to PDF
Turn an HTML file into a paginated PDF, at the page size, orientation and margin you set.
What this tool does
HTML to PDF sends your file to LibreOffice running headless on the processing service, which imports the markup as a document and writes it out through its PDF export filter. Files ending .html, .htm, .md and .txt are accepted, and the PDF comes back carrying the source file's name. Convert one file per run, though: the picker will let you select several, and the job then renders only the first of them and drops the rest without saying anything, so start a fresh run for each document rather than adding them all at once.
The engine behind this markup to PDF conversion is a document importer, not a browser, and that is the limit worth understanding before you rely on the output. LibreOffice reads structure and basic styling — headings, paragraphs, lists, tables, links, inline and embedded CSS for colour, weight and alignment — and the finished job says so in its own notes. Modern CSS layout is a different matter: flexbox and grid positioning, web fonts and anything a script would have written into the page will not come through the way Chrome or Safari draw them. When the design is the point, your browser's own print-to-PDF renders the page with the engine that laid it out; when the content is the point, this route gives you a clean, text-selectable PDF without opening anything.
Only the file itself is uploaded, which shapes how you should prepare it. A stylesheet, image or font sitting next to the document on your disk is not sent with it, so anything referenced by a relative path is simply missing from the render — inline the CSS into a style block in the head and embed images as data URIs, and a single self-contained file behaves predictably. The .md and .txt extensions are accepted as convenience, not as a Markdown feature: there is no Markdown parser anywhere in this path, so a heading written as # stays a literal hash. Markdown Preview renders that properly and you can print from there.
Page size, orientation and margin are applied as a real @page rule that is injected into the document before it reaches LibreOffice. Explicit millimetre dimensions are written rather than names, because LibreOffice's HTML import ignores "size: A3" and quietly renders A4 — so A4 becomes 210 by 297, US Letter 216 by 279 and A3 297 by 420, swapped when you pick landscape. Margins are clamped into the nought-to-60 mm range, and because the injected rule goes in first, a document carrying its own @page rule later on will override what you chose here. Background printing and footer page numbers are not offered at all, since the HTML import exposes no way to honour them; run the finished file through Add Page Numbers if you need folios. The work happens on the server: your file travels over an encrypted connection, uploads are capped at 200 MB, a render is stopped if it passes two minutes, and the upload is erased the moment the render finishes — should the job fail instead, it waits for the same periodic sweep that clears the returned PDF and the job record holding your settings once the job expires.
How to use it
- Make the file self-contained. Inline the stylesheet and embed images as data URIs. Only the file you choose is uploaded, so linked assets on your disk will not be part of the render.
- Add one file. A single .html, .htm, .md or .txt file, up to 200 MB. Choosing several in one go still returns only the first as a PDF, so convert the next one in its own run.
- Set the page size, orientation and margin. A4, US Letter or A3, portrait or landscape, and a margin in millimetres — 15 by default, and anything above 60 is clamped to 60.
- Run the render and open the result. Two minutes is the ceiling for a job. Check any table or multi-column section first, since that is where a document importer diverges from a browser.
Processing & privacy
Secure server processing. This operation requires temporary server processing.
Common use cases
An invoice or report from a system that only exports HTML
Billing tools, analytics dashboards and internal admin screens often emit markup and nothing else. This gives you the attachment the recipient expects.
Documentation or release notes written in plain HTML
A hand-written page of headings, lists and tables is exactly the kind of structure the importer handles well, and it paginates cleanly.
Sending someone a page they will not open as .html
An HTML attachment triggers a security warning in plenty of mail clients and opens in a browser rather than a reader. A PDF avoids both.
Filing a saved confirmation or receipt page
A one-file save keeps for years as a PDF, where an HTML copy depends on assets and a stylesheet that may have moved on.
Questions
Is my HTML file uploaded?
Will the PDF look like the page does in my browser?
Can I paste markup instead of choosing a file?
Do external stylesheets, images and web fonts load?
Does it run JavaScript?
Are Markdown files converted as Markdown?
Why did my page size or margin not take effect?
Can I convert several HTML files at once?
Related tools
- Merge PDF — Combine several PDFs into one document in the order you choose.
- Split PDF — Split one PDF into separate documents by page range.
- Compress PDF — Reduce PDF file size while preserving the quality that matters.
- PDF to JPG — Export every page of a PDF as a JPG image.
- JPG to PDF — Turn one or many JPG photos into a single PDF.
- Protect PDF — Add a password and set permissions on a PDF.