Tất cả bài viết

How to Convert HTML to PDF

Paste HTML markup and get a clean, paginated PDF back in seconds.

If you have a chunk of HTML — a formatted report, an exported email, a snippet from a CMS — turning it into a PDF makes it easy to save, print or send without anyone needing to open it in a browser. The conversion keeps headings, lists, tables and basic styling intact.

MakeitPDF's HTML to PDF tool takes pasted HTML code and renders it into a properly paginated PDF, free and directly in your browser.

Key takeaways

  • Paste HTML code directly — no file upload or website URL needed.
  • Supports headings, paragraphs, lists, tables, links and inline styles.
  • Content automatically flows across multiple A4 pages as needed.
  • JavaScript and remote images are not fetched — everything must be in the HTML itself.

How to convert HTML to PDF

  1. 1
  2. 2

    Paste your HTML markup into the text box — a full document or just a snippet both work.

  3. 3

    Click Convert. Content is laid out on A4 pages automatically, paginating as needed.

  4. 4

    Download the finished PDF.

What's supported — and what isn't

Common document elements are fully supported: headings (h1–h3), paragraphs, ordered and unordered lists, links, tables, bold, italic and inline styles. This covers the vast majority of document-style content — reports, formatted text, simple tables.

What's not supported: JavaScript doesn't run, and remote resources like images loaded from an external URL are not fetched during conversion. This tool converts a static HTML document, not a live web page — if you need to convert an actual website, a screenshot-based tool would be more appropriate than pasting its HTML.

Adding images

Since remote image URLs aren't fetched, embed images directly in the HTML as Base64 data URIs instead: <img src="data:image/png;base64,...">. Any online "image to Base64" converter can generate this string from a regular image file — paste the result straight into the src attribute.

Frequently asked questions

Can I convert a web page URL instead of pasting HTML?

No — this tool converts pasted HTML code, not a live URL. If you want to save a specific web page, most browsers have a built-in "Print to PDF" option that captures the page as it renders.

What page size does the PDF use?

Content is laid out on standard A4 pages with margins, and automatically continues onto additional pages if it doesn't fit on one.

Can I control fonts and colors?

Yes — inline CSS styles in your HTML (e.g. style attributes) are respected, alongside a set of sensible default styles for headings, paragraphs and tables.

Will complex CSS layouts render correctly?

Basic document formatting works well. Advanced CSS layout techniques (flexbox, grid, absolute positioning) are not supported — this is a document converter, not a full browser rendering engine.

HTML to PDF

Try HTML to PDF on MakeitPDF — free

Go to HTML to PDF