Convert HTML to PDF in Your Browser, No Upload Needed
For about a decade, "how do I convert HTML to PDF" had one standard answer: wkhtmltopdf. That project was archived on January 2, 2023. Its last stable release dates to 2020, and it ships an unpatched server-side request forgery vulnerability rated 9.8 out of 10. A generation of tutorials still points at abandonware.
So the question is open again. And the replacements sort into two camps: tools that need a Node.js runtime and a full Chrome binary, and websites that want your markup uploaded to their servers. If you just have an HTML file and want a document, neither camp is built for you.
An HTML File Is Usually a Document
What is an .html file, for most of the people searching this? Rarely source code. More often it's an email receipt saved from a mail client. An order confirmation. A bank statement exported from a portal that inexplicably chose HTML. A report some internal tool generated.
Which means it has your name in it. Your address, your order history, sometimes account numbers. "Convert HTML to PDF online" translates to "upload this document to a stranger's server and trust their deletion policy."
The deletion policies, for the record: Smallpdf deletes after one hour, Sejda and iLovePDF after two. I believe them, mostly. But you can't audit a server you don't control, and local conversion makes the whole question moot.
How the Conversion Actually Works
Every HTML to PDF converter is one of two machines.
Layout-engine converters run a real rendering engine against a page box instead of a browser window. Your browser's print dialog does this. So do headless Chrome, and dedicated engines like WeasyPrint and Prince that exist specifically because browsers ignored print CSS for twenty years. Output is vector: selectable text and real fonts, in files that stay small.
Rasterizers draw the rendered page to a canvas and embed the picture. Output is an image of your document, paginated into slices. Pixel-faithful to what the renderer could draw, but the text is pixels now, and files run larger.
Neither is "better." Vector output wins for contracts and anything a recipient might search. Raster output wins when you want the page to look exactly like it looked, with zero font or layout drift on someone else's machine.
The Online Converter Catch
Here's the part that surprised me while comparing tools: several of the big-name converters don't accept HTML.
iLovePDF's HTML tool is URL-only, one link at a time. You cannot hand it a file or paste markup. Smallpdf's converter in this category is a webpage-capture tool too. If what you have is a file on disk, the field narrows to a handful of uploaders like Sejda, which does take files and pasted code, but processes them server-side and caps the free tier at three tasks per hour.
For live web pages, a URL-based capture is sometimes what you want, and that's a different job with different tradeoffs. For a file that's already on your machine, uploading it somewhere just to get it back re-encoded is a strange detour.
Convert the File Without Uploading It
OxygenPDF's Create PDF tool has an HTML mode that runs the whole pipeline in your browser tab, from reading your markup to assembling the finished PDF. Nothing is sent anywhere. No account, no watermark. No hourly quota either.
The steps:
- Open Create PDF and switch to the HTML tab
- Paste your markup, or import a .html file from disk
- Check the live preview and adjust the HTML if something looks off
- Create the PDF, then download it or continue straight into Edit PDF
Honesty about what you get: this is a rasterizing converter. It renders your HTML at 2× scale and embeds the pages as images, so the output is a visual document, not a text-layer PDF. Static markup only, since scripts never execute. That's the right shape for receipts, confirmations, templates, and snippets. If you need the text searchable afterward, run the result through OCR and it gains a text layer.
If You Need Full Print Control
Two alternatives for the cases the browser tool isn't built for.
The first is print CSS in your own browser. Open the HTML file, print to PDF, and control the output from inside the document: @page { margin: 1in } for margins (body margins don't reliably survive printing), break-inside: avoid to keep tables whole, pt units instead of px. As of Chrome 131 and Safari 18.2 you can even do proper running headers and page numbers with @page margin boxes, a gap in browser printing that stood for two decades.
The second is headless Chrome, for developers. Puppeteer's page.pdf() is the current production standard for generating invoices and reports from templates. Two defaults bite everyone once: printBackground is false, so backgrounds vanish until you opt in, and CSS page sizes lose to the API's format option unless you set preferCSSPageSize.
The Short Version
The old default is dead. Online tools either refuse files or upload them, and the developer tools assume you're shipping a service.
For the everyday case, a saved HTML document that needs to become a portable one, convert it in your browser and skip the upload entirely. Your receipt doesn't need a field trip through someone else's server to become a PDF.
Rohman

