All tools

Convert HTML to PDF

Convert HTML files or HTML code to PDF documents.

Drop your file here

Turn HTML into a PDF document. Upload an .html file or paste HTML code, then choose the page size and margins.

How to use HTML to PDF

  1. Choose an .html file, or click or paste HTML code instead.
  2. Check or edit the code in the HTML code box.
  3. Pick a Page size and Margins.
  4. Click Convert to PDF.
  5. Download the PDF.

What it does

  • Works with an uploaded .html or .htm file or pasted HTML code
  • Uploaded files can be edited in the code box before converting
  • Page size: A4 or US Letter
  • Margins: None, Normal or Wide
  • Supports CSS written in the HTML, including style tags
  • Page breaks are placed in blank space where possible so lines are not cut in half

Good to know

  • Web page addresses (URLs) cannot be converted; paste the page's HTML instead.
  • Scripts in the HTML are not run, so content built by JavaScript will not appear.
  • PDF pages are images, so the text cannot be selected or searched, and links are not clickable.

Your files and privacy

The HTML is rendered and converted inside your browser and is not uploaded to Docshar's server; only images your HTML links to on other websites are fetched from those sites. If you are signed in, Docshar counts your operations (tool, number of files, sizes and page counts), never the file contents. See the Privacy Policy.

Questions

Can I convert a website by entering its URL?

No. A browser cannot download other websites by address without a server. Save the page as an .html file or paste its HTML code instead.

Do images in my HTML appear in the PDF?

Images embedded in the HTML (for example as data URLs) appear. Images linked from other websites are loaded by your browser and may be missing if that site blocks it or is slow to respond.

Is JavaScript supported?

No. Scripts and event handlers are removed before conversion, so only the static HTML and CSS are rendered.