Convert HTML to PDF
HTML to PDF renders an uploaded .html or .htm file, or a ZIP that contains HTML, into a PDF with WeasyPrint. JavaScript does not run, so pages built by scripts come out incomplete.
Drag and drop files here, or click to choose
Accepts HTML, HTM, ZIP · up to 500.0 MB per file · up to 20 files at once
You can also paste a file with Ctrl/Cmd+V, or from the clipboard menu.
HTML to PDF renders with WeasyPrint. Upload a `.html` / `.htm` file, or a ZIP that contains at least one `.html` (`index.html` at the archive root is used if present, otherwise the first `.html` entry). The result is a PDF named after the upload.
The `zoom` field is ignored. There is no headless Chrome and no JavaScript execution. External images, stylesheets and fonts are fetched from public web addresses (at most 500 resources, 64 MiB each, 15 seconds per request), and addresses on private or internal networks are blocked. Relative assets inside a ZIP resolve from the extracted files.
CSS that WeasyPrint supports will print. Script-heavy apps, webfonts that never download, and modern JS layouts often collapse. Encrypted PDFs are not an input; this tool starts from HTML.
If the source is already a URL, use URL to PDF. If the source is Markdown, use Markdown to PDF (CommonMark then the same WeasyPrint step).
A single upload is written to disk as one HTML file and rendered as is. Nothing is added around it: no print stylesheet, no page size, no fonts. Page size and margins come from your own CSS, for example an `@page` rule, and otherwise from WeasyPrint's defaults.
Inside a ZIP, only entries whose names end in `.html` are considered when there is no root `index.html`; a `.htm` file inside the archive is not picked up. An archive with no such entry is rejected with the message that the ZIP must contain an .html file, and an entry name that tries to escape the extraction folder (for example with `..`) is rejected as well.
The PDF is named after the upload, so `invoice-2041.html` returns `invoice-2041.pdf`. Rendering is killed after 180 seconds by default, which a very large or slow-to-fetch page can hit.
Features
- WeasyPrint, not Chromium
- Accepts HTML or a ZIP (index.html, or else the first .html, is rendered)
- zoom is ignored; no JavaScript
- Anonymous API at /api/v1/convert/html/pdf
When to use this tool
- Print a static invoice HTML to PDF
- Render a CSS-based report that does not need JS
- Turn a small HTML+assets ZIP into a PDF
- Archive an exported HTML email or receipt as a fixed document
- Check how a print stylesheet paginates before shipping it
How do I convert HTML to a PDF?
- Upload an HTML file or a ZIP that includes HTML.
- Skip zoom; it does not change the render.
- Click Process and download the PDF.
- Check fonts and pagination. JS-only pages will look empty or broken.
- If a stylesheet or image is missing, put it in the ZIP next to the HTML and reference it by a relative path, or point to a public web address. Local file paths from your own computer are not available to the server.
- If page breaks fall in awkward places, add CSS page-break rules to the source and render again; the converter itself has no layout settings to tune.
Limits and edge cases
- No JavaScript, no Chrome, no zoom
- WeasyPrint CSS support only
- Remote assets load only from public web addresses; private and internal addresses are blocked
- Rendering stops after 180 seconds by default
- Inside a ZIP only `.html` names are matched, not `.htm`
- No default page size or margins are applied; the layout comes from your CSS
- Upload limit on this website: 500 MB per file, sent in chunks above about 95 MB. A single direct API request body is capped at 100 MB.
Examples
- A semantic HTML letter with local CSS often prints cleanly
- A create-react-app index.html without a build usually prints blank
- A ZIP holding `index.html`, `style.css` and `logo.png` renders index.html, and the relative stylesheet and logo are found in the extracted folder
- A ZIP with `pages/a.html` and `pages/b.html` and no index.html renders only the first .html entry in the archive, not both
Privacy for this tool
Files are uploaded over HTTPS, processed in memory or a short-lived temporary directory on our servers, and deleted when your result is ready. We do not keep copies for later browsing, training, or advertising profiles. See the Privacy Policy for retention details and AdSense cookie disclosures.
Frequently asked questions
- Why is my React app a blank PDF?
- WeasyPrint does not run JavaScript. Send static HTML, not an empty SPA shell.
- Does zoom work?
- No. The converter function takes no params.
- How does a ZIP work?
- If the archive has an index.html at its root, that file is rendered; otherwise the first .html entry is.
- Is this print-to-PDF from Chrome?
- No. It is WeasyPrint's HTML/CSS engine.
- How do I set the paper size and margins?
- In your HTML's CSS, with an @page rule. This page has no paper or margin fields, and unlike Markdown to PDF it does not inject a default stylesheet, so whatever your CSS does not specify is left to the renderer.
- Can the converter load images from my computer?
- Not by a local path. Bundle the images in a ZIP and use relative references, or use a public web address. Addresses on private or internal networks are blocked.
- My ZIP was rejected. Why?
- Either it has no file ending in .html (a .htm file inside the archive does not count), or an entry name tries to leave the extraction folder. Rename the entry to .html and re-zip without parent-directory paths.
- Which tool should I use for a live web page?
- URL to PDF fetches a public address for you. HTML to PDF is for markup you already have as a file.
Last updated:
Call this from code
Every tool on this site is a plain REST endpoint - no account or API key needed for anonymous use. Built for AI agents and developers as much as for browsers.
curl -X POST "https://pdf123.xyz/api/v1/convert/html/pdf" \
-F "[email protected]" \
-o output.pdfAlso available as an MCP tool for agent clients that speak Model Context Protocol (JSON-RPC 2.0 over POST /mcp). Full API reference
Use it from an AI agent
SkillClaude Code, Codex, Cursor and other AI agents can run HTML To PDF for you with this skill: /skills/pdf123-html-to-pdf.md
Files are used only for this processing job and deleted automatically afterward.