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
- Open HTML to PDF.
- Upload your .html file, or switch to Paste HTML code.
- Choose the paper size and margins.
- Check the live preview and click Download PDF.
HTML to PDF
Convert HTML to PDF in your browser. Nothing is uploaded.
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 “?”.
