Loading HTML to PDF Converter...
Please wait a moment

How to Convert HTML to PDF - Step by Step Guide

Step 1

Input Your HTML Content

Start by adding your HTML content to the converter. Whether you're converting from Word to HTML or using our HTML editor, you have multiple convenient options:

•
Paste HTML directly: Copy your HTML code from your editor or web page source and paste it into the input area
•
Upload HTML file: Click "Upload" to select .html, .htm, or .txt files from your computer
•
Try the sample: Click "Sample" to load a complete HTML document example

Example: HTML Document Input

Here's what a typical HTML document looks like:

<!DOCTYPE html>
<html>
<head>
  <title>My Document</title>
  <style>body { font-family: Arial; }</style>
</head>
<body>
  <h1>Welcome to PDF</h1>
</body>
</html>
Step 2

Check the Preview

The preview pane shows your page the way it will be drawn for the PDF. It doesn't check your markup for mistakes, so for that run it through our HTML validator before conversion:

•
Live preview: Updates half a second after you stop typing, with scripts switched off
•
Forgiving rendering: Like any browser, the preview repairs unclosed tags instead of reporting them
•
Style preservation: CSS styles, fonts, colors, and layouts are maintained
•
Ready badge: Appears once there is something to convert; it is not a validity check

Example: Live Preview

Once the preview has drawn your page, the header shows:

Status: Ready for PDFReady
Step 3

Generate PDF Document

Download the PDF when the preview looks right. If you need to go the other way, use our PDF to HTML converter:

•
One-click conversion: Click "Download PDF"; long pages can take a few seconds
•
Image-based output: The PDF holds a picture of the page, so it looks like the preview but its text can't be selected or searched
•
Multi-page support: Content taller than one A4 page continues on the next page (up to about 50 pages)
•
Automatic download: PDF is saved with a timestamped filename for easy organization
Step 4

Additional Export Options

More ways to save and share your content! You can also convert HTML to other formats using our HTML to JSON or HTML to Markdown converters:

•
Download HTML: Saves the HTML exactly as it is in the editor, as document.html
•
Copy to clipboard: Quick copying for pasting into other applications or editors
•
Untouched markup: Copy and Download keep your scripts and handlers; they are only left out of the preview and PDF
•
Good for: Printing, sharing or archiving a page as it looks

Frequently Asked Questions

How do I convert HTML to PDF with my styling kept?

Paste your HTML into the input box (or upload an .html file) and click Download PDF. The page is drawn the same way the preview shows it, so CSS in a <style> block or inline style attributes carries over: fonts, colors, backgrounds, borders and layout. Stylesheets and images on other sites only show up if they load in the browser, so keep the CSS inside the file for the most reliable result.

Can I select or search the text in the PDF?

No. The converter takes a picture of the rendered page and places it on A4 pages, much like a screenshot. That keeps the layout looking right, but the text in the PDF is part of the image, so it can't be selected, copied or searched, and the file is bigger than a text PDF would be. If you need real text, use your browser's Print dialog and choose Save as PDF.

What happens with long HTML pages?

The page is drawn at A4 width, and anything taller than one page continues on the next A4 page, so a long report becomes several pages. The cut between pages falls wherever the page height ends, which can split a line of text or a table row in two. Very long pages stop after about 50 A4 pages.

Do scripts in my HTML run?

No. The preview and the PDF are both drawn in a sandboxed frame with scripts switched off, and script tags, onclick-style event handlers, javascript: links and meta refresh tags are removed first. Anything a script would normally build on the page is therefore missing from the PDF. Copy and Download HTML still give you your markup exactly as you typed it.

Are images and tables included in the PDF?

Tables are, with their borders and colors. Images are included when the browser can load and read them: images embedded as data: URLs always work, while images from another site only appear if that site allows it. If you mainly want the data out of a table, the HTML to Table converter pulls it into rows you can copy.

Is my HTML uploaded anywhere?

No. The preview and the PDF are made in your browser, and the HTML is never sent to our server. The only network requests come from your own HTML, for example images or fonts it links to.

Related: HTML to Table, HTML Formatter, HTML Beautifier and HTML Minifier.