↑↓ Move↵ OpenEsc Close

DocumentsFree HTML converter

HTML to PDF

Turn HTML code, a saved web page or content copied from a site into a PDF you can send or print. It's made in your browser, so your HTML is never uploaded.

Highlights

  • Paste code or a page
  • Selectable text
  • Made on your device
  • No sign-up

How to Convert HTML to PDF

This converter reads your HTML and saves it as a PDF, ready to send, attach or print. Paste HTML code, open a saved .html file, or copy part of any web page and paste it in.

The PDF is made inside this browser tab. Your HTML is never uploaded, so it's safe for private pages and internal reports.

Two ways to save it

  • Download PDF sets your content as a clean document: 2 cm margins, page numbers, tidy tables and code, and text you can select. Your page's own CSS isn't used.
  • Print with page styles keeps your CSS — colours, fonts and layout. It opens your browser's print dialog, where you choose Save as PDF.
  • Scripts never run. Only the HTML and CSS are used.

An example page is already loaded, so you can try Step 2 straight away. In Step 1: Add HTML, clear it and paste your own HTML, open an .html file, or copy part of a web page. In Step 2: Download, choose the paper size, then download the PDF or print it with your page's styles.

Step 1 of 2 Done

Add HTML

Paste HTML code or content copied from a web page, open an .html file, or use the example.

or drop a file here. It stays on this device.

.html, .htm or .xhtml · up to 10 MB

No text found in this HTML. If it's a whole page, try turning off Main content only in Step 2.
Example

2,167 characters · 57 lines

In the PDF

The content of your PDF will appear here.

Step 2 of 2

Download your PDF

Choose the paper size and what to include, then download the PDF or print it with your page's own styles.

Paper size
.pdf
Include

There's no text to put in the PDF yet.

Download PDF uses the content shown in the preview, not your page's CSS. To keep colours, fonts and layout, use Print with page styles and choose Save as PDF as the printer.

HTML to PDF guide

From HTML to a file anyone can open

HTML is made for browsers, and it's awkward to send, file or print as it is. A PDF looks the same on every device. This tool gives you two ways to get one: a clean document of your content, or your page exactly as styled.

The basics

How does HTML to PDF work?

Download PDF doesn't take a screenshot. It reads the structure of your HTML and lays it out as real PDF text, which gives sharp printing, small files and text you can select.

1

Read

Your HTML is parsed in the browser. Scripts, styles, forms and, if you choose, menus and footers are left out.

2

Structure

Headings, paragraphs, lists, tables, code, quotes, links and images are picked out.

3

Lay out

The content is typeset with margins, page numbers and page breaks that keep headings with their text.

4

Save

The finished PDF is saved by your browser. Nothing is uploaded.

What carries over

HTML elements in the PDF

How each part of your HTML is set by Download PDF.

HTMLIn the PDFGood to know
<h1> to <h6>Six-step type scaleKept with the next paragraph so they never end a page.
<p>, <strong>, <em>10.5 pt body textBold, italic, strikethrough and inline code are kept.
<ul>, <ol>Bullets and numbersNested levels indent. Checkbox lists show ticked or empty boxes.
<table>Ruled tableShaded header that repeats on each page. Rows never split.
<pre>, <code>Shaded monospace blockIndentation is exact. Blocks up to 40 lines are kept on one page.
<blockquote>Ruled, muted quoteA thin left rule with italic text.
<a href>Clickable linkLinks to web addresses stay clickable.
<img>Embedded PNG/JPEGScaled to fit the page width. Needs a full https:// address.

Use cases

When to convert HTML to PDF

Whenever someone needs a fixed copy rather than a web page.

Email templates

Send a client or manager a PDF proof of a newsletter or transactional email.

Reports

Turn an HTML report or export from another tool into a document you can attach.

Saved articles

Keep a clean, readable copy of an article or help page for offline reading.

Invoices & receipts

Save HTML invoices and receipts with their layout using Print with page styles.

Documentation

Turn a docs page or README rendered as HTML into a handout.

Archiving

Keep a copy of a page as it was, in a format that won't change.

Set expectations

What this converter can't do (yet)

It works on the HTML you give it, without a server or a full browser engine behind it.

Limit 1

CSS in downloads

Download PDF uses its own print styling, not yours. Print with page styles keeps your CSS.

Limit 2

JavaScript

Scripts don't run, so content a script adds after the page loads won't appear.

Limit 3

URLs & relative paths

It can't fetch a page by its address, and relative image or stylesheet paths can't be found.

Limit 4

Some scripts

Chinese, Japanese, Korean, Arabic, Hebrew and emoji aren't in the downloaded PDF's font yet.

Want to edit the content first? Convert it with HTML to Markdown, change it, then use Markdown to PDF.

Common questions

HTML to PDF FAQ

Quick answers about turning HTML into PDF files.

How do I convert HTML to PDF?

Paste your HTML code into Step 1, open a saved .html file, or copy part of a web page and paste it in. Check the preview, then in Step 2 choose A4 or US Letter and press Download PDF. The file is saved straight to your downloads folder.

Is my HTML uploaded to make the PDF?

No. The PDF is made inside your browser tab, so your HTML stays on your device. If your HTML links to images on other websites, your browser downloads those images to place them in the PDF, just as it would to show them.

Why doesn't the downloaded PDF look like my web page?

Download PDF keeps your content (headings, paragraphs, lists, tables, code, links and images) and sets it as a clean document with its own print styling. It doesn't use your page's CSS, so colours, fonts, columns and backgrounds aren't carried over. To keep them, use Print with page styles.

How do I keep my CSS styling in the PDF?

Press Print with page styles. Your HTML opens in your browser's print dialog with its own CSS. Choose Save as PDF (or Microsoft Print to PDF on Windows) as the printer and save. Turn on Background graphics in the dialog's settings if your page uses background colours. Styles in a separate .css file that the page links to are only used if the browser can reach that file, so paste the CSS into a <style> tag for the most reliable result.

Does JavaScript in my HTML run?

No. Scripts are ignored by both options, for your safety. Content that a script would have added to the page, such as a chart or a list loaded from a server, won't appear. Save the page from your browser after it has loaded and paste that HTML instead.

Why didn't my image appear?

Images need a full web address (https://…) to be found, because pasted HTML has no website around it, so an address like img/photo.png points nowhere. Download PDF can include PNG and JPEG images; other formats, and images on sites that don't allow other pages to use them, appear as a link with the image's alt text.

Can I convert a web page by its URL?

Not directly. Open the page, press Ctrl+S (Cmd+S on a Mac) to save it as an .html file, then open that file in Step 1. Or select the part of the page you want, copy it and paste it into Step 1.

Is the text in the PDF selectable and searchable?

Yes. With Download PDF, the PDF contains real text, not a picture of the page, so you can search it, select and copy from it, and links stay clickable. Most browsers' Save as PDF keeps text selectable too.

What page size and margins does it use?

Choose A4 (210 × 297 mm) or US Letter (8.5 × 11 in). The tool picks the usual size for your region to start with. Pages have 2 cm (about 0.8 in) margins. Downloaded PDFs longer than one page get page numbers. When printing with page styles, any @page rules in your own CSS take priority.

Why does a character show as a blank box?

The font in downloaded PDFs covers Latin, Greek and Cyrillic alphabets. Chinese, Japanese, Korean, Arabic, Hebrew, Indic scripts and most emoji aren't included yet. Print with page styles uses your computer's fonts, so it handles them.

Is there a limit?

Make as many PDFs as you like, with no sign-up. HTML files can be up to 10 MB, and documents of a few hundred pages are fine. Very long pages take a few seconds to build.

Related converters

These tools also run in your browser, with no sign-up and nothing uploaded.