Skip to content
FileDagadu

PDF 2 min read

How to Convert HTML to PDF for Free (File or Pasted Code)

Turn an HTML file or pasted HTML code into a small, searchable PDF in your browser, and learn which HTML and CSS features are supported.

Need a PDF from an HTML page, an email template or a bit of code? You can convert it in your browser, either by uploading an .html file or by pasting the code.

How to convert

  1. Open HTML to PDF.
  2. Upload your .html file, or switch to Paste HTML code.
  3. Choose the paper size and margins.
  4. Check the live preview and click Download PDF.

HTML to PDF

Convert HTML to PDF in your browser. Nothing is uploaded.

Try it free

What is supported

  • Headings, paragraphs, bold, italic, underline and links.
  • Bulleted and numbered lists, including nested lists.
  • Tables with borders, shaded header cells and column spans.
  • Colours, font sizes and text alignment, including simple rules in a style tag.
  • Pictures embedded in the HTML as data: images.
  • Page breaks set with page-break-before or page-break-after.

What is not supported

JavaScript is not run. External stylesheets, linked pictures, flexbox, grid, floats, web fonts and positioned layouts are not supported. Linked pictures appear as a text label. For this reason the PDF will not match a browser’s “Print to PDF” exactly, but it is small and the text is selectable and searchable.

Privacy

Your HTML is converted in your browser and never uploaded.

Frequently asked questions

Can I paste HTML instead of uploading a file?

Yes. Use the Paste HTML code tab and the PDF updates as you type.

Why are my pictures missing?

Linked pictures cannot be loaded. Embed them in the HTML as data: images.

Will Hindi text work?

No. The PDF fonts built into the tool cover English (Latin) characters only, so other scripts show as “?”.

Free tools mentioned in this guide

Keep reading