Convert HTML code to a PDF document
Paste HTML or upload a .html file and get a paginated PDF. Self-contained pages work best: external images, stylesheets and fonts are not fetched, and JavaScript does not run.
- Files are processed temporarily and automatically deleted.
- No account needed
- No watermark added
- Works on any device
How it works
Step 1: Paste your HTML into the box, or upload a .html or .htm file.
Step 2: Choose the page size (A4 or Letter) and the margins.
Step 3: Select Convert to PDF.
Step 4: Download the PDF and check the page breaks.
How HTML becomes a PDF
The converter uses WeasyPrint, an engine built specifically to lay out HTML and CSS as printed pages. It reads your markup and stylesheet, works out where lines and page breaks fall, and writes the result as a PDF with real, selectable text. It does not take a screenshot of a web page.
Because the aim is print, CSS for paged media applies: @page rules, page-break properties and print-oriented styling behave as they would for a printed document. You pick A4 or US Letter and the margins in the tool, and your own CSS can refine them.
Your HTML is sent over HTTPS to our server, processed in a private temporary folder with restricted resources and deleted as soon as the PDF has been delivered.
Why use this tool
Made for print layout
WeasyPrint understands paged media CSS, so headings, tables and page breaks can be controlled with the same stylesheet rules used for printing.
Real text, not a screenshot
The PDF contains selectable, searchable text and sharp vector borders, and stays small compared with an image of the page.
Safe by design
The converter never fetches outside resources and does not run scripts, so untrusted markup cannot pull in remote content or execute code.
Paste or upload
Work directly from a snippet copied out of an editor or email template, or hand over a whole saved page.
Common uses
Invoices from a template
Developers can turn a generated invoice or receipt page into a PDF while testing the print styles, before wiring it into an application.
Saving an email template as a document
Paste the source of a newsletter or letter and produce a PDF copy for records, with images embedded so it looks complete.
Reports and certificates
Design a certificate or one-page report in HTML and CSS, control the layout precisely, and export it for printing.
Documentation and CVs
Write a CV or a README-style handout in HTML, style it once and export a PDF that is consistent every time.
Testing print stylesheets
Check how a page's page-break rules and margins behave when paginated, without opening a browser's print dialog.
Writing HTML that converts cleanly
Because nothing is fetched from the internet, the file you provide has to carry everything it needs. Put your CSS in a style element in the head. Turn images into data URIs, which are long strings that begin with data:image/png;base64, and use them as the image source. A logo or chart embedded this way appears in the PDF; the same image referenced by a web address does not.
Think in pages, not screens. Use an @page rule to set margins, avoid pixel-wide layouts that assume a large monitor, and keep table headers readable by allowing rows to break between pages. A modest stylesheet that sets font-size, line-height and page-break-inside: avoid for cards or table rows will usually beat a complicated one.
- Include a complete document with an html, head and body, and a charset meta tag such as UTF-8.
- Embed every image as a data URI and keep the CSS in the document.
- Use page-break-before or page-break-after on headings to control where sections start.
- Avoid scripts: whatever they would add at load time will be missing.
Supported formats
- Input
- HTML pasted into the page, or a .html / .htm file. Self-contained markup with inline or embedded CSS works best.
- Output
- One PDF file, A4 or US Letter.
Rendered with WeasyPrint on our server. Not a web page capture.
Good to know
- External resources are never fetched. Images, stylesheets and fonts referenced by URL do not load; embed images as data URIs and put CSS inside the document.
- JavaScript is not executed, so content generated by scripts does not appear in the PDF.
- This is print rendering, so a page designed for screens (fixed widths, sticky menus, viewport units) may need print styles to look right.
- Fonts installed on the server are used; a font you have only on your own computer is not available unless embedded with a data URI.
- The HTML is sent to our server for conversion; use a browser-based tool if it must never be transmitted.
Processed temporarily on our server
This conversion needs server-side software. Your file is uploaded over an encrypted connection, converted in a private temporary folder, returned to you, and then deleted immediately. Files are also deleted if the job fails, times out or is cancelled, and a cleanup task removes anything left after 20 minutes.
Frequently asked questions
Is my HTML uploaded to a server?
Yes. Conversion runs on our server with WeasyPrint, so what you paste or upload is sent over HTTPS, processed temporarily and deleted automatically after the PDF is delivered.
Why are my images missing from the PDF?
Because images referenced by URL are never fetched, for security reasons. Convert them to data URIs and embed them directly in the HTML, then convert again.
Does JavaScript run before the PDF is made?
No. Scripts are not executed, so anything they would create, such as charts drawn in the browser or content loaded dynamically, will not appear. Provide the finished HTML instead.
Can I convert a live web page by entering its address?
No. This tool converts HTML you paste or upload and does not visit web addresses. Save the page's source as a self-contained file first if you want to convert it.
What page sizes and margins are available?
You can choose A4 or US Letter and set the margins in the tool. Your own @page CSS can refine them further.