ToolJutsu
All tools
PDF Tools

HTML to PDF

Convert HTML pages into print-ready PDFs.

Paper size
Orientation

Scripts and inline event handlers are removed before rendering — the tool never executes pasted markup.

Processed on your device. We never see your files.

How to use HTML to PDF

What is HTML?

HTML (HyperText Markup Language) is the format every web page is written in. It uses nested tags — <h1>, <p>, <table>, <ul> and hundreds more — to describe the structure and content of a document, with CSS layered on top to control how it looks. Where a Markdown file is a hint to a converter, HTML is the actual rendered language of the web. Every browser, every email client and every modern e-reader speaks it natively, which makes it the universal source format for anything that started life on the internet.

What is a PDF?

A PDF (Portable Document Format) is a self-contained document file, created by Adobe in the early 1990s and now an open ISO standard. Where HTML re-flows to fit whatever screen it lands on, a PDF carries the finished, fixed-size layout — paper, page breaks, fonts, margins and all. When you want a piece of writing to look identical on every device, print cleanly and be archived in a single file, PDF is the format you hand someone.

Why convert HTML to PDF?

The most common reason is printing or archiving a web page. Browser print-to-PDF is fine for simple pages, but it strips the custom CSS, mangles backgrounds, drops images and re-flows the layout in unhelpful ways. A dedicated converter that takes the HTML you actually want — perhaps copied from your browser’s DevTools — and renders it to a PDF gives you full control over what ends up on the page.

The next reason is reports and invoices. Many small business tools, internal dashboards and prototype apps build their report layout in HTML/CSS because that is what their stack is best at. Turning that HTML into a downloadable PDF on demand — in the browser, with no server-side render pipeline to maintain — is a common need.

The third reason is certificates, badges and one-pagers. Whether it is a course certificate, an event ticket, a meal voucher or a marketing one-pager, HTML is the easiest way to lay out a visually rich single page, and a PDF is the right format to send it.

The fourth reason is email-friendly snapshots. Pasting an HTML snippet into an email is brittle (clients rewrite the markup) and attaching a .html file looks unprofessional. A PDF rendered from the same HTML drops cleanly into any mail thread.

How to use this HTML to PDF converter

  1. Paste your HTML into the HTML markup box, or drop an .html file onto the dropzone above it. Full documents and partial snippets both work — if you drop a complete page, the converter automatically extracts the <body> content.
  2. Pick a paper size — A4 if you are in Europe, India or most of the world, US Letter in the United States and Canada, US Legal for very tall pages.
  3. Pick an orientation — portrait for typical pages, landscape for wide tables and dashboard-style layouts.
  4. Optionally edit the filename — the result downloads as your-name.pdf.
  5. Click Convert to PDF. The HTML is rendered to a hidden canvas via html2canvas, sliced into page-sized JPGs and assembled into a PDF by pdf-lib. The download starts when it is finished.

Quality tips for HTML to PDF

Because the renderer takes a snapshot of the HTML at the width of your chosen paper, the snippet you paste should already be styled — colours, fonts, padding and table widths all come from the inline CSS you provide. If you copy from a styled page, also copy the relevant <style> block or inline the styles into each element’s style="..." attribute. External stylesheets and web fonts will not load.

System fonts (Arial, Helvetica, Times, Georgia, system-ui) are safest. If you need a specific brand font, embed it as a data: URI inside an inline @font-face rule. Otherwise html2canvas falls back to the closest system font on the rendering machine, which is usually fine but never pixel-identical to your design.

For long documents, add a comfortable margin-bottom to headings and sections — page breaks fall at fixed pixel intervals and will sometimes land inside a paragraph. A bit of vertical space gives the renderer a sympathetic place to split.

If you need the output text to be selectable and searchable, this is not the right tool — use Markdown to PDF instead. This tool is for visual fidelity; selectable-text PDFs are a different trade-off.

Privacy

Your HTML never leaves your browser tab. The html2canvas render, the JPG slicing and the pdf-lib assembly all run in JavaScript on your device. The libraries are loaded once from this site and then cached — after that, conversion works completely offline, which you can verify in your browser’s Network panel or by switching off Wi-Fi before clicking Convert to PDF.

Browser compatibility

The output is a real PDF 1.7 file with embedded JPG page images. It opens identically in Adobe Acrobat, Apple Preview, the built-in PDF viewers in Chrome, Edge, Firefox and Safari, mobile readers on iOS and Android, and on every mainstream Linux distribution. html2canvas itself works in every modern evergreen browser; the only failure mode is when a snippet references resources (images, fonts, stylesheets) that cannot be fetched, in which case those resources are simply omitted from the render.

Frequently asked questions

Is the text in the output PDF selectable and searchable?
Honestly — no. This converter renders your HTML to a canvas with html2canvas, slices that canvas into page-sized JPGs and embeds them in a PDF via pdf-lib. The result is an image-based PDF: it looks pixel-perfect and prints beautifully, but each page is a picture, so you cannot select or copy text out of it, and search inside a PDF reader will not find words. If you need selectable text, use the Markdown to PDF or CSV to PDF tools instead — those write real text into the PDF.
Which CSS works, and which doesn't?
Inline CSS (in style="..." attributes) and <style> blocks inside the snippet you paste both work. Layout properties — colours, padding, margins, flex, grid, borders, font sizes, line heights — render the way they look in a normal browser. What does not work: external stylesheets fetched by <link rel="stylesheet">, web fonts loaded with @font-face from a CDN, JavaScript-driven layout (any script is stripped before rendering), and CSS that depends on parent elements outside the snippet. If you want a specific font, embed it as a base64 data: URI in the snippet, or fall back to system fonts.
How does pagination work for long documents?
The rendered canvas is sliced into strips the height of one PDF page (A4, Letter or Legal at your chosen orientation) and each strip becomes one page. The slicing happens at fixed pixel intervals — it does not know about paragraphs or headings, so a page break can fall partway through a line of text. For documents where clean breaks matter, add CSS margin-bottom before sections so the natural break lines up at a comfortable point, or shorten the snippet.
Why does my JavaScript-driven layout look wrong?
The converter strips <script> tags and inline onclick-style event handlers before rendering — for safety, it never executes pasted markup. So anything your page builds in JavaScript at load time (charts, dynamic tables, framework-rendered components) will be missing from the output. The fix is to capture the rendered HTML from your browser's developer tools (Elements → copy outerHTML) and paste that static snapshot into the converter instead.
Is my HTML sent to a server?
No. The html2canvas render, the JPG slicing and the pdf-lib assembly all run in JavaScript inside your browser tab. The HTML you paste, and any .html file you drop, never travel across a network. The libraries are loaded once from this site and then cached. After loading you can disconnect from the internet and the converter still works.

Related tools