← Back to blog
How To · 2026

HTML to PDF Converter Online Free: Complete 2026 Guide

May 4, 2026·11 min read

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.

Quick answer (20 seconds)
  1. Open iHatePDF HTML to PDF
  2. Choose your input: upload .html, .htm, .xhtml from device or cloud, OR paste a URL
  3. Click Convert to PDF, the engine renders CSS, images, fonts, and JavaScript
  4. Download your PDF
  5. 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:

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.

  1. Open the converter. Visit iHatePDF HTML to PDF in any web browser.
  2. Select the File tab. The upload area accepts .html, .htm, and .xhtml files.
  3. Upload your HTML file. Drag and drop onto the upload area, or click to browse. Cloud import works from Google Drive, Dropbox, and OneDrive.
  4. The engine reads the HTML. Structure, CSS, embedded styles, image references, and font declarations are all parsed.
  5. 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.
  6. 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.

  1. Open the converter. Visit iHatePDF HTML to PDF in any web browser.
  2. Select the URL tab. A text field appears for the URL.
  3. Paste the URL. Public web pages work without authentication. Pages behind login walls require the public version or alternative export workflow.
  4. 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.
  5. 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 featureHow 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 graphicsRendered 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 listsPreserved with original markers
Hyperlinks (a tags)Clickable in the PDF
JavaScript-rendered contentExecuted before capture, included
Charts drawn by JavaScriptRendered to canvas, captured as graphics
Single-page apps (React, Vue, Angular)Rendered then converted
CSS animations and transitionsCaptured at final state (PDF is static)
Video and audio elementsPoster image or first frame captured
Form fields (input, textarea, select)Captured as visual snapshot, not interactive
iframesRendered 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?

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

ScenarioWhy HTML to PDF
Save articles for offline readingRead anywhere without internet
Archive web pagesCapture state before content changes
HTML email export to PDFArchive correspondence for records
HTML invoice template to PDFApp-generated invoice delivery
Documentation page snapshotPreserve as PDF for version control
Analytics dashboard to PDFShare with non-login stakeholders
HTML report from a tool to PDFClient-ready deliverable format
Receipt or order confirmationFile for taxes, expenses, returns
Research paper from journal siteSave before paywall or access change
Product page archivalReference for legal, comparison, audit
HTML newsletter to PDFDistribute as universal-format file
HTML report generated by codeDeveloper-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:

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:

  1. Open Safari and visit ihatepdf.com/html-to-pdf
  2. Tap File tab to upload a .html file from Files, or tap URL tab to paste a URL
  3. For URL: copy the URL from any other app (Safari address bar, Mail, Messages) and paste
  4. Tap Convert to PDF and wait for processing
  5. The PDF saves to Files under Downloads, ready to share via Mail, Messages, or any other app

On Android:

  1. Open Chrome and visit ihatepdf.com/html-to-pdf
  2. Tap File tab to upload, or URL tab to paste a URL
  3. Tap Convert to PDF
  4. 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

Workflow chaining

HTML to PDF is often the first step in a longer workflow. Common chains:

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.

Convert your HTML to PDF in seconds

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.

Webpage to PDFWord to PDFExcel to PDFPPTX to PDFMerge PDFCompress PDFSign PDFProtect PDFJPG to PDF
Show all tools →

Related guides