Skip to main content
ToolCube – All tools at one place.

HTML to PDF Converter

Turn an HTML file, a ZIP with its CSS and images, or pasted code into a clean PDF with real, selectable text. Your code stays on your device.

  • Real selectable text
  • Files stay on your device
  • No sign-up

Loading HTML to PDF…

How to Use

How to Convert HTML to PDF

Go from an HTML file or code to a finished PDF in four steps.

  1. 1

    Step 1: Add Your HTML

    Upload an .html file, its whole folder, a .zip with its CSS, images and fonts, or paste your code.

  2. 2

    Step 2: Check the Preview

    The preview is the PDF itself, page by page, made from the finished page in a safe sandbox.

  3. 3

    Step 3: Set Up the Page

    Choose the size, orientation, margins, scale, background and page numbers.

  4. 4

    Step 4: Download

    Press Download PDF, or Best quality to save it with your browser's print dialog.

Guide

Four ways to add your HTML

  • An HTML file. Upload a single .html or .htm file with its styles inside, ideal for exported reports and receipts.
  • A folder. Upload the page's whole folder, or drag it in. Stylesheets, images and fonts linked with relative paths are found, even in sub-folders.
  • A ZIP. The same, packed in one file. If it holds several pages, you choose which one to convert.
  • Pasted code. Type or paste into the editor and watch the live preview. There's a dedicated page for converting HTML code to PDF.

Two ways to create the PDF

Download PDF makes the file in one click. Every word is real, selectable text with embedded fonts, links stay clickable, and effects such as shadows, rounded corners and gradients are drawn by your browser behind the text. The preview shows this exact file.

Best quality opens the page in your browser's own print dialog with the page size and margins you chose. Pick “Save as PDF” there for the browser's full print engine. It is a good choice for very complex designs.

Page settings explained

Size and orientation: A4, Letter, Legal or a custom size in millimeters or inches, upright or sideways. Margins: none, small, normal, large or your own value. Scale: from 50 to 150 percent. Fit to width is on by default and shrinks wide layouts so nothing is cut off at the side. Backgrounds can be turned off to save ink. Header and footer can add page numbers, the date and the title.

If your HTML has an @page rule, its size and margins are used automatically. The page keeps its screen look unless you turn off Use screen styles; then print styles apply, so anything hidden with @media print stays out of the PDF. The properties break-before, break-after and break-inside, and their older page-break names, decide where pages end.

A real PDF, not a screenshot

Many converters take a picture of the page and paste it into a PDF, which gives you blurry text you can't search. This tool reads where the browser placed every word and writes it as real text with embedded, subset fonts. You can select and copy it, screen readers can read it, and files stay small. Web fonts from your ZIP are embedded when their license allows; otherwise a similar open font is used. Urdu and Arabic are shaped and ordered properly.

Lines, table rows and images aren't sliced between pages, table headers repeat on each new page, and links stay clickable, including links that jump within the document.

Safe for code you didn't write

Your page runs in an isolated sandbox, separate from this site. Its scripts can't read your cookies or other files, open pop-ups, submit forms or leave the frame. With Load online files on, your browser downloads the page's fonts, styles and images from their websites, as when you open the page; turn it off to keep everything offline. What reaches the PDF is a static copy of the finished page, with no scripts. Anything missing is listed, so you can add it to the folder or ZIP. Your files never leave your device.

Honest limitations

Most pages convert with the same look. A PDF can't play animations, so the finished frame is captured, and FAQs and accordions are opened. Files on websites that don't allow copying can't be included. Rotated or gradient-filled text is added as an image.

Common uses include saving invoices, reports, receipts, documentation and newsletters. Afterwards you can combine files with Merge PDF, add a password with Protect PDF, or, for Office documents, use Word to PDF. To print the HTML source itself, with syntax highlighting and line numbers, use Code to PDF.

Features

Why Use This HTML to PDF Converter?

A real document rather than a picture of a web page.

  • Real Selectable Text

    Text can be searched and copied, with fonts embedded in the file.

  • Folders and ZIPs

    Upload a page with its CSS, images and web fonts as a folder or a ZIP.

  • Paste Code

    Type or paste HTML and watch a live preview as you go.

  • Clean Page Breaks

    Lines, table rows and pictures stay whole, and table headers repeat.

  • Working Links

    Web addresses and links within the page stay clickable.

  • Urdu and Arabic

    Right-to-left text is joined and ordered correctly.

  • Print CSS Respected

    @page rules, print styles and page-break properties are followed.

  • Safe and Private

    Scripts run only in an isolated sandbox, and nothing is uploaded.

FAQ

Frequently Asked Questions

Answers to common questions about HTML to PDF on ToolCube.

How do I convert an HTML file to PDF?

Upload your .html file above, check the preview of the PDF, choose the page size and margins, and press Download PDF. If the page uses separate CSS or images, upload its whole folder or a ZIP instead.

Can I convert a website link to PDF?

Not by its link. For privacy and security, browsers don't let one website load another, and nothing here is sent to a server that could fetch it for you. Instead, open the page in your browser, press Ctrl+S (Cmd+S on a Mac), choose “Webpage, Complete”, then upload the saved HTML file together with its folder, or both in a ZIP.

Is the text in the PDF selectable?

Yes. Each word is written as real text with an embedded font, so you can select, copy and search it. Pages aren't turned into pictures.

Why is my CSS missing?

Usually because only the .html file was uploaded, while its stylesheet is a separate file. Upload the whole folder or a ZIP, and styles, images and fonts linked with relative paths are included. The report after uploading lists anything still missing.

Why are some online images or fonts missing?

With Load online files on, your browser downloads the page's online CSS, fonts and images, just as when you open the page. A few websites don't allow their files to be copied, and these are listed. Save them into your page's folder and upload the folder, or turn the option off to keep everything offline.

Does JavaScript run when I convert?

Yes, while Run page scripts is on. The page runs in an isolated sandbox with no access to this site, your cookies or your other files, and it can't open pop-ups, submit forms or leave its frame. When it has finished, a static copy is made, so content built with JavaScript appears. Turn the option off to remove scripts instead.

How do I control page breaks?

Use the CSS properties break-before, break-after and break-inside, or the older page-break versions. Lines, table rows and images are kept whole automatically.

Does it support @page and print styles?

Yes. By default the PDF keeps the page's screen look, as on the website. Turn off Use screen styles to apply the rules inside @media print instead. A size or margin set with @page is used by default, and you can turn that off to use the options on this page.

Can I add page numbers?

Yes. Open Header and footer to add “Page 1 of N”, the date and the document title, at the top or bottom of each page and aligned left, center or right.

Will the PDF look exactly like my web page?

Most pages convert with the same look, including rounded corners, shadows, gradients and blur, which your browser draws for the PDF. FAQs and collapsed sections are opened, so their answers are included. The preview shows exactly what you will get.

Can the PDF show my page's animations?

No. A PDF can't play animations, so the finished frame is captured. Parts that fade or slide in are shown in their final place, counters show their final number, and videos, canvas drawings, 3D scenes and animated GIFs show the frame on screen at that moment.

What is Best quality mode?

It opens your page in your browser's own print dialog, with the page size and margins you chose. Choose “Save as PDF” there. The browser's print engine gives the most faithful result; Download PDF is quicker and keeps links and text the same way.

Are my files uploaded?

No. Your HTML, CSS, images and fonts are read and converted in your browser. Nothing is sent to a server, so it's safe for invoices, reports and other private documents.