HTML to PDF

Convert HTML to a clean, printable PDF with selectable text.

Your HTML source code is converted into a printable PDF locally in your browser without server uploads. See our privacy policy for details.

How to convert HTML to PDF

  1. Paste your HTML markup into the input box or click Choose a file to open a local .html or .htm file.
  2. Select A4 or US Letter page size.
  3. Click Make PDF and then Save PDF to download the PDF document.

Note how this tool processes HTML: it formats and prints the HTML source code itself in a clean, fixed-width Courier font with line breaks and indentation preserved—not a visual browser screenshot of a live website. That makes it ideal for archiving template markup, submitting HTML assignments for code review, documenting email template source code, or printing DOM snippets with selectable, copyable tags.

Worked example: Printing an 85-line HTML email template source to A4 PDF

Suppose you need to attach the source markup of a transactional receipt template (invoice_template.html, 85 lines, 3.4 KB) to a compliance review ticket that only accepts PDF attachments:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Order Receipt #4089</title>
  </head>

When you load invoice_template.html, choose A4, and press Make PDF, every angle bracket (< and >), attribute quote, and 2-space indentation level is written literally into a 2-page PDF (14.8 KB) using the built-in PDF Courier font. Reviewers can open the PDF, search for specific tag names or class attributes with Ctrl+F, and copy snippets directly out of the page.

Limits and what this tool cannot do

  • Prints HTML source markup, not rendered web pages: This tool does not execute JavaScript, fetch external CSS stylesheets, load remote <img> URLs, or render a visual layout. If you want a visual PDF of how a web page looks in a browser, open the HTML file in Chrome, Edge, or Firefox (or use our HTML Viewer) and press Ctrl+P / Cmd+P → Save as PDF.
  • Cannot convert by entering a website URL: Because the site runs statically in your browser with no backend server, it cannot fetch external URLs. You must paste HTML text or select a local .html file.
  • Standard Latin font coverage: The PDF is generated with the standard Type 1 Courier font (WinAnsiEncoding). Characters outside Western European Latin (such as CJK, Arabic, Devanagari, or emoji) are replaced with ? and counted in the summary notice.

Questions

Why does the PDF show my HTML tags (

,

) instead of rendering the web page?

This tool is a source-code-to-PDF printer that formats raw HTML markup in a monospaced font for code review and documentation. To render the visual page with CSS and images, open the file in your browser and choose Print -> Save as PDF.

Can I paste a website URL to convert a live web page to PDF?

No. This tool does not fetch third-party websites; open an HTML file from your device instead.

Are the HTML tags in the generated PDF selectable and copyable?

Yes. The output uses native PDF text streams in Courier rather than rasterized pictures, so every tag and attribute can be searched and copied.

How are long lines of minified HTML handled?

Long lines that reach the right margin of the A4 or US Letter page wrap cleanly onto the next line so no characters are cut off at the edge of the sheet.

Last reviewed .

Related converters and guides