HTML to PDF Converter - Convert HTML to PDF Online
Turn HTML documents into A4 PDF files that look like the rendered page.
How to Convert HTML to PDF - Step by Step Guide
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:
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>
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:
Example: Live Preview
Once the preview has drawn your page, the header shows:
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:
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:
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.
Related Tools
HTML Viewer
View and preview HTML code online with safe rendering and structure analysis
HTML to Table
Extract and convert HTML tables to structured data with Excel export
HTML Fixer
Fix broken HTML automatically, repair unclosed tags, mismatched elements, and syntax errors
HTML Formatter
Format and beautify HTML code with proper indentation and syntax highlighting
PDF to HTML
Convert PDF documents to clean HTML code with preserved formatting and structure
HTML Editor
Write, edit, and preview HTML code online with real-time rendering and syntax highlighting