How to Convert HTML to PDF (Keep the Layout)
HTML is perfect for the web but awkward to email or print. Converting an HTML file to PDF gives you a fixed, shareable document with the layout locked in — ideal for invoices, receipts, reports, and templates. Here's how to do it, and when a different tool is the better choice.
Convert HTML to PDF in three steps
Use the HTML to PDF converter:
- Open HTML to PDF and choose your
.htmlfile. - Click Convert to PDF.
- Download the PDF with the page layout preserved.
HTML file vs. a live web page
This tool converts an HTML file you upload. If you instead want to save a page that's already online by its address, use URL to PDF — paste the link and it renders the live page to PDF.
Tips for a clean result
- Inline your CSS. Styles inside the HTML (or in a
<style>block) apply reliably; separate stylesheet files may not travel with a single uploaded file. - Embed images. Images referenced by a local path won't be found — use full
https://URLs or base64 data URIs so they render in the PDF. - Use print-friendly widths. Design around an A4/Letter width so nothing important is cut off at the page edge.
Other ways to make a PDF
Writing in Markdown? Turn it into HTML first with Markdown to HTML. Just have plain text? Use Text to PDF. Explore all our PDF tools.
FAQ
Is this free?
HTML to PDF is an OhoTool Pro tool. Most of our tools are free; the document converters are part of Pro.
What happens to my file?
It's processed securely on our server only to perform the conversion, then deleted right after.
Why do my images or styles look wrong?
Usually because they point to local files or an external stylesheet. Inline your CSS and use absolute image URLs (or data URIs) so everything is self-contained.