To convert HTML to PDF, paste your HTML code or upload an .html file below, choose a paper size such as A4 or Letter, and click Convert to PDF. ScreenshotAPI.net renders the markup in a real browser with your CSS and JavaScript applied, then gives you a PDF to preview and download for free, with no signup.
Free to use. No account required.
The whole job takes under a minute, and it works the same for a single line of markup or a full HTML file with its own styles.
Paste HTML code into the editor, or switch to the upload tab and drop in an .html or .htm file from your computer.
custom_htmlPick A4, Letter, Legal, A3, A5, or Tabloid, turn on landscape for wide tables, and enter a page range if you only need part of the document.
format · landscape · page_rangeClick Convert to PDF. The markup is rendered in a real browser, paginated to your paper size, and shown in the preview so you can download it.
file_type=pdfBoth inputs go through the same renderer, so pick whichever matches where your HTML lives right now.
Best for snippets, email templates, and markup your app generates on the fly. Paste anything from a single tag to a full document with a <head>. Styles in a <style> block or a style attribute are applied, and you see a live preview before you convert.
Best when you already have a saved page, an exported report, or a template on disk. The file is read in your browser and sent as HTML, so it never needs a public URL. Files up to 1 MB work in the free tool. Larger documents go through the API.
One limit applies to both: a single HTML file cannot carry the folders next to it. Images, fonts, and stylesheets that sit beside the file on your disk will not load, so link them with full https:// URLs or inline them.
The paper size decides how wide your layout is allowed to be. A4 portrait is narrower than most desktop screens, so a page that looks fine in the browser can wrap differently on paper. Here are the sizes side by side, drawn to scale.
pdf_options[format]pdf_options[landscape]pdf_options[page_range]pdf_options[media]=printpdf_options[print_background]The free converter covers paper size, landscape, and page range. Print media and backgrounds are available on the API.
A PDF is only as good as the engine that lays out the HTML. ScreenshotAPI.net renders it in a browser first, which is why the PDF matches the preview. Four things are worth knowing.
<img src="images/logo.png"><img src="https://example.com/logo.png">Both end in a PDF, but they start from different places. If you want to save HTML as PDF and the HTML is in your hands, use this page. If it lives at a web address, use the webpage converter.
You are here
Different input
Any document that starts life as a template is a good fit. Write it once in HTML and CSS, then turn every copy into a PDF.
Keep one HTML invoice template, fill in the numbers, and turn each one into an A4 or Letter PDF that is ready to email.
Export a monthly report built with HTML tables and charts as a PDF that clients can file and print without a login.
Design a certificate once in HTML and CSS, switch to landscape, and produce a personalised PDF for every attendee.
Render event tickets and boarding passes with a QR code image from a URL, sized to fit a single printed page.
Turn the HTML receipt your checkout already sends by email into a PDF copy customers can download later.
Generate quotes and agreements from HTML templates on Legal or Letter paper, keeping fonts and spacing consistent.
Generating invoices or certificates from your app? Send the same HTML in a POST request and get the PDF back in one call, from cURL, JavaScript, Python, or any language that speaks HTTP.
custom_htmlpdf_options.formatpdf_options.landscapepdf_options.page_rangeThe best HTML to PDF converter depends on what you start with. Here is how this tool compares with two popular free pages, including the places where they do more.
| Feature | ScreenshotAPI.net | Pdfcrowd | Smallpdf |
|---|---|---|---|
| Paste HTML code | Yes | Yes | No |
| Upload an .html file | Yes | Yes | Yes |
| Convert from a URL | Separate tool | Yes | No |
| Paper size and landscape | Yes | Paid license | No |
| Custom margins, footers, and page numbers | No | Paid license | No |
| Upload a zip with images and CSS | No | Yes | No |
Based on each tool's public HTML to PDF page, checked October 2026. Pdfcrowd's inputs are free, but its settings panel, which holds page size, orientation, margins, and footer page numbers, is locked until you buy a license, and free output carries Pdfcrowd branding. For a URL, ScreenshotAPI.net has a separate webpage to PDF converter.
Common questions about converting HTML code and HTML files to PDF, missing images, and automating it with the ScreenshotAPI.net API.
Don't see your question here?
Browse all help articles