HTML to PDF
Paste HTML code or open a saved .html file, check the preview, and save a PDF with real, selectable text. Your code is converted on your device and never uploaded.
- Files stay on your device. Nothing is uploaded.
- Free, no sign-up, no daily limit.
- Works with Wi-Fi off once the page has loaded. Check it yourself
Updated by Khokhar Sab
How do I convert HTML to PDF?
Press Choose an HTML file, or Paste HTML code to start with a blank editor. The preview shows the page at the width of your paper. Pick the paper size, orientation and margins, keep or drop the page's own styles, then press Convert to PDF and Download. The PDF takes its name from your file.
- Press Choose an HTML file, or Paste HTML code.
- Check the Preview next to the code.
- Pick Paper, Orientation and Margins.
- Press Convert to PDF, then Download.
How do I save a web page as a PDF?
This page cannot open a web address for you, because browsers stop one site from reading another site's pages. Two routes work. Open the page and use your browser's Print command with Save as PDF as the printer. Or save the page with Save page as, HTML only, and open that file here to choose paper and margins.
Does it keep CSS styles?
It keeps CSS written in style tags and style attributes: colors, backgrounds, borders, tables, spacing and widths. Stylesheets linked from other sites are not loaded. Fonts are swapped for DejaVu Sans, Serif or Mono, matching the kind your CSS asked for, so the text can be embedded in the PDF and stays selectable.
| In your HTML | In the PDF |
|---|---|
| Text, headings, lists, tables | Kept, as real text |
CSS in <style> tags and style="" | Kept |
| Background colors and borders | Kept |
| Images as data URLs | Kept |
| Images from other sites | Kept only when that site allows it |
| JavaScript, forms, iframes, video | Left out |
| Web fonts | Replaced with DejaVu fonts of the same kind |
Is the PDF text searchable or an image?
Searchable. Some converters screenshot the page and wrap the picture in a PDF, so the text cannot be found or copied. This tool reads where the browser placed every word and writes that text into the PDF. In our test, a styled 926-word page became a 5-page PDF of 44 KB in 0.2 seconds.
Measured on 2026-10-12 in Chrome 152 on an i5-8350U laptop, A4, normal margins. Times are after the first conversion, which also loads the fonts and adds about a second.
Can developers use it for invoices or reports?
Yes, for one document at a time. Build the invoice as HTML with inline CSS, paste it in, and download the PDF. Tables, borders and background colors come through. For automatic conversion of many files on a server you need a server-side library; this page is meant for people converting by hand, privately.
Limits and fixes
- Web addresses cannot be converted directly; save the page as HTML or use the browser's Print to PDF.
- JavaScript never runs, so charts or content drawn by scripts will be missing.
- Positioned layouts: fixed headers, flex and grid come through as laid out at the paper width, but elements are not repeated on every page.
- Pages wider than the paper, such as a fixed 1,000 px layout, are fitted to the paper width so nothing is cut off at the right edge. Untick Fit wide pages to the paper to keep the exact widths.
- Pictures and style files on your computer cannot be opened by a web page, so only the HTML file comes in. The tool names any it leaves out, under the editor.
- Rounded corners and shadows are drawn square and without shadows.
- Characters: DejaVu covers Latin, Greek and Cyrillic, and Noto Sans SC and KR cover Chinese, Japanese and Korean. Emoji and Arabic shaping are left out of the PDF. Japanese kanji use the Chinese letterforms, which differ slightly for some characters.
Frequently asked questions
Is it free?
Yes, with no sign-up, no watermark and no limit on the number of files.
Is my HTML uploaded?
No. The code is laid out and written into a PDF inside your browser.
Why do some images not show?
An image from another site only appears when that site allows other pages to read it. Embed it as a data URL to be sure.
Can I set the page size?
Yes: A4, US Letter or US Legal, portrait or landscape, with narrow, normal or wide margins.
What about Markdown?
Use Markdown to PDF, which turns Markdown into styled HTML first and then into a PDF.
Related PDF tools
Learn more
How this tool was built and tested
- MDN: Same-origin policy: why a web page cannot fetch another site to convert it
- DOMPurify (Apache-2.0): removes scripts and unsafe parts of pasted HTML
- DejaVu fonts: the fonts embedded in the PDF
- pdf-lib, Cantoo fork (MIT): writes the PDF, its text, links and bookmarks