HTML to PDF

Convert HTML code, an .html file or a webpage URL into a high-quality PDF — control page size, margins, scale, background colours, fonts and more.

Paste HTML Upload .html URL Fetch 100% Free
index.html

Drop an HTML file or click to browse

Accepts .html and .htm files

index.html
0 KB · HTML
Enter a Webpage URL
⚠️ Many websites block cross-origin loading (CORS). If the page fails to load, paste the page's HTML source directly using the Paste HTML tab instead.
Live Preview
Page
Layout
Style
Advanced
Paper Size
A4
210×297 mm
A3
297×420 mm
Letter
216×279 mm
Legal
216×356 mm
Orientation
Portrait
Vertical
Landscape
Horizontal
Margins (mm)
Top / Bottom 15 mm
Left / Right 15 mm
Scale & Zoom
Page Scale 100%
Line Height 1.5
Colours
Background Colour
Text Colour
Typography
Font Family
Base Font Size
Options
Print Background
Include background colors & images
Page Numbers
Add page number footer
Header / Footer
Show document title in header
Auto Page Break
Break long content across pages
Output Filename
HTML to PDF
Paste HTML code, upload an .html file, or load a webpage URL. Adjust page size, margins, scale and styles, then convert instantly in-browser.
Code
Input Mode
A4
Page Size
Pages
File Size
3 input modes — paste raw HTML directly into the code editor, upload a local .html file, or load a page from a URL.
Full PDF control — A4/A3/Letter/Legal page sizes, portrait/landscape, custom margins, scale, background colour, fonts and page numbers.
100% in-browser — uses html2canvas + jsPDF. No data is ever sent to any server. Works fully offline after the page loads.

How to Convert HTML to PDF

1

Choose Input

Select Paste HTML, Upload .html file, or enter a URL to load a webpage into the editor.

2

Preview

Click Preview to see a live render of your HTML in the iframe before converting.

3

Configure

Set page size, orientation, margins, scale, colours, fonts and advanced options in the tabs.

4

Convert & Download

Click Convert to PDF — the PDF is generated instantly in-browser and ready to download.

Frequently Asked Questions

Does it support CSS and JavaScript?
Yes. The HTML is rendered in a sandboxed iframe using the browser's own rendering engine, so CSS styles and inline JavaScript are fully applied before capture.
Why does the URL mode sometimes fail?
Many websites send an X-Frame-Options or Content-Security-Policy header that blocks iframe embedding. Use the Paste HTML mode and paste the page's source (Ctrl+U) instead.
Will images in my HTML render correctly?
Inline base64 images and images from the same origin render correctly. External images may be blocked by CORS. Use base64-encoded images for guaranteed rendering.
Can I convert multi-page documents?
Yes. Long HTML content is automatically split across multiple PDF pages based on the selected page height. Enable Auto Page Break in the Advanced tab for best results.
Is my HTML content uploaded to a server?
Never. html2canvas captures the rendered page entirely in your browser and jsPDF builds the PDF locally. Nothing is transmitted to any server at any point.
What is the maximum HTML file size?
There is no hard limit. Very large HTML files with many embedded images may take a few seconds longer to process depending on device memory and CPU speed.
No upload · No server · html2canvas + jsPDF in-browser · Free forever · Pdf Pixy