HTML to PDF Converter Online Free: Complete 2026 Guide
You have HTML content that needs to become a PDF. Maybe a long article you want to save for offline reading. Maybe an HTML email export from Outlook or Gmail you need to archive. Maybe an invoice template your app generates as HTML that you need to deliver as PDF. Maybe a documentation page you want to keep as a snapshot. Maybe an analytics report rendered as HTML that goes into a client deliverable. Maybe a live web page you need to capture in its current state for a record. Whatever the source, you need that HTML in PDF format: layout intact, CSS rendered, images embedded, ready to view on any device without a browser.
iHatePDF HTML to PDF converter handles it two ways: upload a .html, .htm, or .xhtml file from your device or cloud, OR paste a URL to convert a live web page. Both methods produce a clean PDF with CSS styling, images, fonts, hyperlinks, and JavaScript-rendered content preserved. The engine uses browser-grade rendering, so modern HTML5 features, single-page application content, dynamically-loaded charts, and responsive layouts all render correctly before conversion. Free, no watermark, no signup needed for single conversions. A free account unlocks batch processing for up to 3 files or URLs at once. This guide covers everything: both conversion methods, what gets preserved, comparison versus browser Print to PDF, batch and mobile workflows, and common HTML-to-PDF troubleshooting for developers and end users alike.
- Open iHatePDF HTML to PDF
- Choose your input: upload .html, .htm, .xhtml from device or cloud, OR paste a URL
- Click Convert to PDF, the engine renders CSS, images, fonts, and JavaScript
- Download your PDF
- Optional: chain into Merge, Compress, Sign, or Protect without re-uploading
Why convert HTML to PDF?
HTML is built for browsers. PDF is built for delivery, archiving, and universal viewing. Converting from HTML to PDF is the bridge between "here is the web content" and "here is the locked, portable, universally-viewable version."
Eight concrete reasons people convert HTML to PDF:
- Offline reading. Save long articles, blog posts, and documentation as PDFs you can read on the plane, train, or anywhere without a connection.
- Archive web pages. Capture a page in its current state before it changes, gets paywalled, or disappears. Critical for legal records, research, and audit trails.
- Generate PDFs from HTML templates. Apps that produce invoices, receipts, reports, or contracts as HTML can convert to PDF for client delivery. Web developers love this workflow.
- Convert HTML email exports. Outlook, Gmail, and other email clients export emails as HTML. Convert these to PDF for filing, evidence, or compliance.
- Save analytics dashboards. HTML dashboards (Google Analytics, custom reporting tools) become shareable PDFs for executives who do not log in.
- Print-friendly versions. Convert web articles to clean PDFs with margins, page numbers, and your printer choice of paper size.
- Universal sharing. Recipients without your specific browser or who block scripts still see exactly what you sent.
- Embed in larger documents. Combine HTML-derived content with Word PDFs, scanned documents, or Excel reports in a single deliverable using Merge PDF.
Method 1: Convert HTML file (upload)
When you have HTML content saved locally (downloaded articles, email exports, generated reports, internal documentation), upload the file directly.
- Open the converter. Visit iHatePDF HTML to PDF in any web browser.
- Select the File tab. The upload area accepts .html, .htm, and .xhtml files.
- Upload your HTML file. Drag and drop onto the upload area, or click to browse. Cloud import works from Google Drive, Dropbox, and OneDrive.
- The engine reads the HTML. Structure, CSS, embedded styles, image references, and font declarations are all parsed.
- Click Convert to PDF. The page renders in a virtual browser, CSS applies, images load (from absolute URLs in the HTML), fonts are fetched, JavaScript executes, then the rendered output captures as PDF pages.
- Download the PDF. Save to your device or back to your cloud.
Tip for HTML files with relative image paths: If your HTML references images using relative paths (like "images/photo.jpg"), the images may not appear because the converter cannot resolve relative paths to your local filesystem. Either change references to absolute URLs (full http or https), or convert all images to base64 inline encoding within the HTML before uploading.
Method 2: Convert a live URL
When you want to capture a live web page, paste its URL. The engine visits the page from our servers and converts whatever renders.
- Open the converter. Visit iHatePDF HTML to PDF in any web browser.
- Select the URL tab. A text field appears for the URL.
- Paste the URL. Public web pages work without authentication. Pages behind login walls require the public version or alternative export workflow.
- Click Convert to PDF. The engine visits the URL, waits for the page to fully render (including JavaScript), then captures the rendered output as PDF pages.
- Download the PDF. Save to your device or cloud.
URL method is best for: archiving public articles, capturing online receipts, saving documentation snapshots, converting analytics dashboards (if publicly accessible), and any case where the page exists on the web and you want a frozen PDF copy. Compare with the dedicated Webpage to PDF guide for URL-focused conversion details.
What gets preserved in the conversion
Browser-grade rendering means the PDF looks like the page does in a modern browser. Here is exactly what carries through:
| HTML element or feature | How it appears in the PDF |
|---|---|
| Text content (headings, paragraphs) | Preserved exactly |
| CSS styling (colours, fonts, spacing) | Rendered and preserved |
| CSS3 features (flexbox, grid, gradients) | Rendered at final visual state |
| Print stylesheets (@media print) | Applied for cleanest print output |
| Images (jpg, png, webp, gif) | Embedded at original quality |
| SVG graphics | Rendered as vector graphics (sharp at any zoom) |
| Web fonts (Google Fonts, @font-face) | Fetched and embedded |
| Tables (HTML table elements) | Preserved with borders, alignment, shading |
| Bullet and numbered lists | Preserved with original markers |
| Hyperlinks (a tags) | Clickable in the PDF |
| JavaScript-rendered content | Executed before capture, included |
| Charts drawn by JavaScript | Rendered to canvas, captured as graphics |
| Single-page apps (React, Vue, Angular) | Rendered then converted |
| CSS animations and transitions | Captured at final state (PDF is static) |
| Video and audio elements | Poster image or first frame captured |
| Form fields (input, textarea, select) | Captured as visual snapshot, not interactive |
| iframes | Rendered when same-origin or accessible |
| Page breaks (CSS page-break-after) | Respected in the PDF |
HTML to PDF vs browser Print to PDF
Every modern browser has Print to PDF built in (File menu, Print, Save as PDF). It works. So why use a dedicated converter?
- Browser Print to PDF is fine for one-off personal conversions on your own computer. Open the page, hit Print, choose PDF, done. Best for single ad-hoc captures.
- iHatePDF HTML to PDF wins on six dimensions: (1) batch conversion of up to 3 files or URLs at once, (2) cloud import and export to Drive, Dropbox, OneDrive, (3) consistent results across operating systems (your colleague gets the same PDF you do), (4) tool chaining into Merge, Compress, Sign, or Protect without re-uploading, (5) headless URL conversion (no need to open the page in a browser tab first), and (6) mobile-friendly conversion when you do not have desktop access.
For developers: iHatePDF behaves like a headless browser, which is the same engine that powers tools like Puppeteer and Playwright when used for PDF generation. The difference is you skip writing and maintaining the headless browser code yourself.
Common HTML to PDF use cases
| Scenario | Why HTML to PDF |
|---|---|
| Save articles for offline reading | Read anywhere without internet |
| Archive web pages | Capture state before content changes |
| HTML email export to PDF | Archive correspondence for records |
| HTML invoice template to PDF | App-generated invoice delivery |
| Documentation page snapshot | Preserve as PDF for version control |
| Analytics dashboard to PDF | Share with non-login stakeholders |
| HTML report from a tool to PDF | Client-ready deliverable format |
| Receipt or order confirmation | File for taxes, expenses, returns |
| Research paper from journal site | Save before paywall or access change |
| Product page archival | Reference for legal, comparison, audit |
| HTML newsletter to PDF | Distribute as universal-format file |
| HTML report generated by code | Developer-friendly programmatic output |
Common HTML to PDF issues (and fixes)
CSS styling missing or not applied
Most often happens when CSS is referenced by relative URLs in an uploaded HTML file. Fix: Change CSS link references to absolute URLs (full http or https), or inline the styles in a style block inside the HTML file. For URL-based conversion this is rarely an issue because the page references work as-is.
Images not appearing in the PDF
Same root cause as CSS: relative image paths in uploaded HTML files cannot resolve. Fix: Use absolute image URLs in the HTML file, or convert images to base64 inline encoding so they are part of the HTML itself. URL-based conversion handles images automatically when they are publicly accessible.
JavaScript-rendered content missing
The engine includes a reasonable wait window for JavaScript to finish rendering before capturing. Fix: For very heavy single-page apps that take many seconds to fully load, ensure your app does not require user interaction to trigger rendering (e.g. no "click to load" gates). For dashboards with deferred loading, paste the URL of a fully-rendered version.
Fonts substituted with similar ones
Custom fonts loaded from non-public servers or behind authentication cannot be fetched. Fix: Use Google Fonts, Adobe Fonts (Typekit), or other public CDN-hosted fonts. The engine fetches and embeds these correctly. For internal fonts, switch to web-safe fonts in your CSS print stylesheet.
Page breaks in awkward places
Default page breaks happen at the bottom of each PDF page, which may split content. Fix: Add CSS print rules in your HTML: use page-break-before, page-break-after, or page-break-inside properties on headings, sections, or images that should not split. Modern alternative: break-before, break-after, break-inside.
Layout cut off at page edges
Wide layouts may exceed standard PDF page width. Fix: Add a print stylesheet that targets @media print and adjusts widths to fit within typical page constraints. Set max-width and use responsive units (percent, viewport units, or em) instead of fixed pixels for the print layout.
Form fields appearing as plain text
Form inputs (input, textarea, select) capture as visual snapshots, not interactive form fields. Fix: This is expected behaviour. PDF static format. If you need fillable PDF forms, use a dedicated form-creation tool that produces native PDF form fields.
Batch HTML to PDF (free account)
Single conversions work without an account. For converting multiple HTML files or URLs at once, sign in to your free iHatePDF account: up to 3 conversions simultaneously, each becoming its own PDF.
Batch is the right choice for:
- Documentation snapshots. Three documentation pages converted to PDF for a versioned reference pack.
- Article archival. Three articles you want to save for later, converted in parallel.
- HTML email batch. Three email exports from Outlook or Gmail converted to PDF for compliance filing.
- Multi-page web archival. Three URLs from a related series (chapters of a guide, parts of a long article) converted together.
- Generated report batch. Three HTML reports from your tool converted at once for client packets.
- Multi-receipt processing. Three online receipts converted to PDF for monthly expense tracking.
Each conversion runs independently in parallel. A problem with one does not affect the others. Free account creation takes about 30 seconds.
Converting HTML to PDF on mobile (iPhone and Android)
Convert from your phone with no app installation. Works in any modern mobile browser.
On iPhone or iPad:
- Open Safari and visit ihatepdf.com/html-to-pdf
- Tap File tab to upload a .html file from Files, or tap URL tab to paste a URL
- For URL: copy the URL from any other app (Safari address bar, Mail, Messages) and paste
- Tap Convert to PDF and wait for processing
- The PDF saves to Files under Downloads, ready to share via Mail, Messages, or any other app
On Android:
- Open Chrome and visit ihatepdf.com/html-to-pdf
- Tap File tab to upload, or URL tab to paste a URL
- Tap Convert to PDF
- The PDF downloads to your Downloads folder, ready to share via Gmail, WhatsApp, or any other app
Conversion quality on mobile is identical to desktop because processing happens on our servers. Useful when reading an article on your phone and wanting to save it as PDF immediately.
Tips for the cleanest HTML to PDF conversion
- Use absolute URLs for images, CSS, and fonts. Relative paths in uploaded HTML files cannot resolve. Absolute paths always work.
- Add a @media print stylesheet. Define print-optimised styles (smaller margins, hide nav, larger fonts). The engine respects these for cleaner output.
- Use Google Fonts or other public CDN fonts. Web-safe fallback chains help guarantee acceptable rendering even when custom fonts are unavailable.
- Set page-break properties for long content. CSS page-break-before, page-break-after, page-break-inside (or the modern break-* variants) prevent awkward content splits.
- Inline SVG renders cleaner than embedded images. SVG stays sharp at any zoom level. Use SVG for logos, icons, and diagrams when possible.
- Test with a complete URL first. Before batching, convert one file or URL to verify quality, then batch the rest.
- For HTML emails, save as full HTML (not just text). Outlook and Gmail both support exporting emails as .html files with all formatting preserved.
- Avoid lazy-loaded images for archival. If converting a page for archive, prefer pages that load all images eagerly. Lazy-loaded images that require scrolling may not be captured.
Workflow chaining
HTML to PDF is often the first step in a longer workflow. Common chains:
- Convert, then merge. Convert HTML article, then Merge PDF with related Word PDFs, scanned documents, or other deliverables.
- Convert, then compress. Convert, then Compress PDF to shrink for email-friendly delivery (especially useful for image-heavy article archives).
- Convert, then sign. Convert an HTML invoice template output, then Sign PDF for formal sign-off.
- Convert, then protect. Convert, then Protect PDF with password for sensitive content.
- URL to PDF, then archive. Convert a URL to PDF as part of a web archival workflow, then combine with screenshot evidence and audit notes.
- HTML email export, then merge correspondence. Convert HTML emails to PDF, then merge with attachments and notes for a comprehensive case file.
Privacy and security
HTML content often includes sensitive information: internal documentation, generated reports with personal data, HTML invoices, email correspondence, financial dashboards. iHatePDF is built with this in mind. Uploaded files and URL fetches process over HTTPS, the resulting PDF returns to you, and source files delete automatically at session end. URL conversions visit pages from our servers without exposing your IP or browser fingerprint. No human review, no AI training, no third-party sharing. GDPR-compliant. Full picture in the privacy and security guide.
Frequently asked questions
Can I upload an HTML file or do I need a URL?
Both work. The converter accepts two input methods: upload a .html, .htm, or .xhtml file directly from your device or cloud storage, or paste a public URL of a web page you want to convert. Use file upload when you have HTML content saved locally (downloaded articles, email exports, generated reports, internal documentation, HTML email newsletters, invoice templates). Use URL paste when you want to capture a live web page in its current state. Both produce the same quality PDF output.
Will CSS and styling be preserved?
Yes. The engine fully renders CSS before converting: external stylesheets, inline styles, embedded style blocks, CSS3 features (flexbox, grid, transforms, gradients, animations frozen at final state), media queries, and print stylesheets when present. Colours, fonts, spacing, borders, backgrounds, and layout all carry through to the PDF exactly as they render in a modern browser. If your HTML has a @media print stylesheet, the engine applies it for the cleanest print-ready output.
Does it handle JavaScript-rendered content?
Yes. The converter executes JavaScript before capturing the page, so dynamically-loaded content, single-page applications (React, Vue, Angular renders), charts drawn by JavaScript (Chart.js, D3, ApexCharts), and any content that requires JS to appear are all included in the PDF. The engine waits for the page to finish rendering before converting. For very heavy JS apps that take time to load, the engine includes a reasonable wait window. This is the key difference from naive HTML-to-PDF tools that capture only the raw HTML source.
What HTML file formats are supported?
.html (standard HTML files), .htm (legacy short extension), and .xhtml (XML-compliant HTML). The engine handles HTML4, HTML5, and XHTML. Modern HTML5 features (semantic elements, canvas, SVG, video, audio elements) all render correctly. Inline images encoded as base64 work the same as externally-referenced images. The converter is browser-grade, not a stripped-down parser.
Will images be included in the PDF?
Yes. Both inline images (base64 encoded) and externally-referenced images (via image source URLs) are loaded and embedded in the PDF. For images referenced by absolute URLs, the converter fetches them at conversion time. For images referenced by relative URLs in uploaded HTML files, ensure your HTML file includes absolute paths or the images are uploaded as part of an HTML bundle. SVG graphics render as vector graphics in the PDF (sharp at any zoom level).
Can I batch convert multiple HTML files at once?
Yes, with a free account. Sign in to your free iHatePDF account and you can batch process up to 3 HTML files (or URLs) simultaneously. Each input becomes its own PDF file. Without an account, convert one at a time. Batch is ideal for converting a series of related documentation pages, a folder of HTML email exports, or multiple URLs you want to archive together.
Will fonts look the same in the PDF?
Yes when your HTML uses web-safe fonts (Arial, Helvetica, Times, Georgia, Courier) or @font-face declarations with publicly accessible font files (Google Fonts, Adobe Fonts via CDN). The engine fetches the referenced fonts and embeds them in the PDF. For custom fonts loaded from non-public servers or behind authentication, substitution may occur. Use Google Fonts or other public CDNs for guaranteed reproduction.
What about responsive and mobile layouts?
By default, the converter uses a desktop viewport (1280 pixels wide), which captures the desktop version of responsive sites. The PDF will be portrait A4 unless your HTML page setup or print CSS specifies otherwise. If your HTML has a @media print stylesheet with custom layout instructions, those are honoured for the cleanest output. For mobile-specific layouts, you can adjust the viewport via URL parameters or @media queries that target print.
Will hyperlinks be clickable in the PDF?
Yes. Hyperlinks in your HTML (a tags with href attributes) become clickable links in the resulting PDF, pointing to the same URLs. Internal anchor links (a tags with href starting with #) work as well, jumping to the appropriate section within the PDF. Email links (mailto:) and telephone links (tel:) also preserve as clickable. The PDF behaves like a smart document, not a flat image.
Can I import HTML files from Google Drive, Dropbox, or OneDrive?
Yes. Click the cloud icon during upload and authenticate once with your cloud provider. After that, browse cloud folders and select .html files directly. The resulting PDF can be saved back to the same cloud location with one click, no local download or re-upload step required.
Are my files and URLs kept private?
Yes. Uploaded HTML files transfer over HTTPS, process on our secure servers, return as PDF, and delete automatically at the end of your session. URLs you paste are visited from our servers without exposing your IP or browser fingerprint. No human review, no AI training, no third-party sharing. GDPR-compliant. Safe for internal documentation, confidential reports, and any other sensitive content.
Does it work on mobile?
Yes. Works in any modern mobile browser (Safari on iPhone, Chrome on Android, Firefox, Edge, Samsung Internet). Upload HTML files from your phone storage or cloud, or paste URLs to convert. The PDF downloads to your Files (iOS) or Downloads folder (Android), ready to share via Mail, Messages, or any other app. Useful when you want to save an article you are reading on your phone as a PDF for later.
How is this different from browser Print to PDF?
Browser Print to PDF is fine for single pages on your own computer but has limits: no batch processing (one page at a time), no cloud import or export, no chaining into other PDF tools (merge, compress, sign), inconsistent results across browsers (Chrome, Safari, Firefox produce slightly different PDFs), and no headless URL conversion (must open each page in a browser tab first). iHatePDF is browser-grade rendering with batch support, cloud integration, and a tool chain for further processing. For one-off personal use, browser print is fine. For everything else, dedicated conversion wins.
Is there a watermark on the PDF?
No. No watermarks, no signup gate for single conversions, no daily caps. The PDF you download is exactly what professional desktop tools would produce. iHatePDF makes money through optional Pro features, not by watermarking free tool output.
Upload a file or paste a URL. CSS, images, fonts, and JavaScript-rendered content preserved. Batch 3 with free account. No watermark, no signup.
Convert HTML to PDF →Use other tools
Free, fast, private PDF tools.
Show all tools →