MergeAny Logo
Free HTML to PDF Converter

HTML to PDF Converter — Free

Convert HTML files with CSS to beautifully rendered PDFs. WeasyPrint-powered. Supports inline styles and base64 images. No signup.

MergeAny combines two or more JPG, JPEG, or PNG images into a single file directly in your browser — vertically, horizontally, or in a grid. There is no upload limit, no watermark, and your files are deleted from our servers seconds after merging. Works on Windows, Mac, iPhone, and Android with no install and no signup.

Merge JPG Files NowWorks on desktop & mobile
Files deleted instantly after merge
Merge up to 20 images at once
Simple 3-step process

How to Convert HTML to PDF

01

Upload Your HTML File

Select an .html or .htm file up to 10 MB. Embed all CSS in a <style> block for best results.

02

WeasyPrint Renders It

WeasyPrint renders the HTML and CSS to a print-quality PDF layout server-side.

03

Download PDF

Click Convert to PDF and save your rendered HTML document as a PDF.

Tips for Best HTML to PDF Results

Since conversion runs server-side without internet access, all resources must be self-contained in your HTML file. Here are the key things to check before uploading:

  • CSS: Move all styles into a <style> block in the <head>. External .css file links won't load.
  • Images: Convert images to base64 data URIs using src="data:image/png;base64,...". External image URLs won't load.
  • Fonts: Use system-safe fonts (Arial, Georgia, Times New Roman) or embed font-face declarations with base64-encoded font data.
  • Page size: Use CSS @page { size: A4; margin: 20mm; } to control page dimensions and margins in the output PDF.

WeasyPrint supports most CSS 2.1 and CSS 3 properties including flexbox, grid basics, page-break rules, and custom properties. It is an excellent choice for generating invoices, reports, and certificates from HTML templates.

Why choose MergeAny

HTML to PDF Conversion Features

Turn any self-contained HTML file into a print-quality PDF.

CSS Support

Inline CSS and <style> block styles are fully supported. Use any CSS properties for layout, typography, and color.

Base64 Images Supported

Embed images as base64 data URIs directly in your HTML — they will render correctly in the output PDF.

WeasyPrint Engine

WeasyPrint is a Python-based PDF rendering engine known for clean, spec-compliant CSS layout output.

Private Processing

Files are processed in isolated server memory and deleted immediately after download.

No JavaScript Execution

HTML structure and CSS styles are rendered. JavaScript is not executed — dynamic content won&apos;t appear.

Browser-Based

No installation required. Works on any device and operating system.

Frequently Asked Questions

Standard HTML5 with inline CSS or linked local CSS is supported. External resources like remote images, Google Fonts, or CDN-hosted stylesheets won't load because the file is processed server-side without internet access. Embed styles inline or in a <style> block for best results.