HTML to PDF β Web Pages & HTML Code to PDF
Turn HTML files, saved web pages and pasted code into PDFs with real, searchable text, working links and page breaks that never cut a line in half. Free and private.
To save a web page with its pictures: in Chrome or Edge press Ctrl+S (Cmd+S on Mac) and choose βWebpage, Single File (.mhtml)β, then drop that file here. You can also pick an .html file together with its images and stylesheets.
Reading the HTMLβ¦
Creating PDFβ¦
The page is laid out by your own browser with its CSS, but scripts are not run, for safety. Videos, embedded frames, floating cookie notices and anything a script would add are left out.
How do I convert HTML to PDF for free?
Open PDFChai’s free HTML to PDF tool and drop in an .html file, or switch to Paste HTML code and paste your markup. For a live web page, first save it in Chrome or Edge with Ctrl+S βΊ Webpage, Single File (.mhtml) so its pictures and styles come along. Choose the page size and layout width (fit to page for documents, desktop for websites) and click Create PDF. The text stays real and searchable, links stay clickable, and pages break between lines. Nothing is uploaded.
PDFChai HTML to PDF vs Other Ways
| Feature | PDFChai | Typical online converters |
|---|---|---|
| Privacy | Laid out and converted in your browser — never uploaded | File or URL processed on a server |
| Modern CSS | Flexbox, grid and web fonts laid out by your own browser | Depends on the server’s engine |
| Text | Real, searchable and selectable | Sometimes a picture of the page |
| Page breaks | Never through a line, picture or table row | Lines can be cut in half |
| Links & bookmarks | Clickable links, headings become bookmarks | Links often lost |
| Cost | Free, no signup, no watermark | Limits or watermarks on free plans |
Comparison reflects common free online converters as of 2026.
What is an HTML to PDF converter?
HTML is how web pages, email newsletters, online invoices, exported reports and documentation are written. It looks great in a browser but is awkward to share, print or archive: links to pictures and stylesheets break, the layout changes with the screen size, and many portals only accept a PDF. Converting HTML to PDF freezes the page into a single file that looks the same everywhere and prints exactly as you see it.
PDFChai lets your own browser lay the page out, so flexbox, grid, web fonts, tables and modern CSS work just as they do on screen. The page is loaded in a sealed, script-free frame; PDFChai then reads the position, colour and font of every box, picture and word and writes them into the PDF as vector content. Text stays real text you can search, select and copy, each word sits exactly where the browser placed it, and shapes, borders and gradients stay sharp at any zoom.
Pages are split between lines of text, never through the middle of a line, a picture or a table row, and headings are kept with the paragraph that follows them. Links stay clickable, links to other parts of the page jump to the right spot, and headings become bookmarks. Everything happens on your device, so private invoices, statements and internal reports are never uploaded.
β‘ Quick Answer:
- Open debugspot.com/html-to-pdf
- Drop an .html or .mhtml file, or paste HTML code
- Choose the page size, margins and layout width
- Keep Bookmarks from headings on for long documents
- Click Create PDF, check the preview, and it downloads
100% free Β· No signup Β· No watermark Β· Files stay on your device
Step-by-Step Guide
Everything you need to know β done in under a minute.
Add the HTML
Drop an .html file, a saved web page (.mhtml), a .zip of a page with its files, or several files together. Or switch to Paste HTML code and paste a full document or just a fragment.
Pick the layout
Choose A4, Letter, Legal, A3 or one long page, portrait or landscape, and the margins. Fit to page suits documents; Desktop, Tablet or Phone width shows a website the way it looks on that screen.
Create the PDF
Click Create PDF. The page is laid out by your browser, split into pages and drawn into the PDF, and a preview of the first pages appears.
Download
The PDF downloads automatically, named after the page. Change an option and create it again as often as you like.
How Does It Work?
Understanding what happens behind the scenes helps you trust the tool β especially with confidential files.
π‘οΈ A sealed, script-free frame
The HTML is loaded into an invisible frame that cannot run scripts, so a page can’t do anything on your computer while it is converted. Animations are switched off so every element shows in its final state.
π¨ Your browser does the layout
Because your own browser lays the page out, modern CSS such as flexbox, grid, custom properties and web fonts behaves exactly as it does on screen.
π€ Every word measured
PDFChai reads the position of every word, box and picture, then writes vector text and shapes into the PDF. Each word is fitted to the width the browser gave it, so lines, columns and tables line up.
π Smart page breaks
Pages break between lines, never through a line of text, a picture or a table row. CSS page breaks (break-before: page) and break-inside: avoid are honoured.
Key Features & Advantages
Searchable text
Real text you can search with Ctrl+F, select and copy.
Clean page breaks
No line of text, picture or table row is cut in half.
Links & bookmarks
Links stay clickable and headings become PDF bookmarks.
Any screen width
Render as a desktop, tablet or phone layout, or fit documents to the page.
Saved web pages
.mhtml files from Chrome and Edge keep their pictures and styles.
Private
The page is never uploaded; scripts in it never run.
Who Uses This Tool?
This is one of the most common document tasks in work, study and everyday life. Here are the people who use it every day.
π» Developers
Turn HTML invoices, receipts, reports and templates into PDFs to check how they print.
π§Ύ Small businesses
Save online orders, booking confirmations and invoices from web pages as PDFs for your records.
π Students & researchers
Keep articles and reference pages as searchable PDFs for offline reading and citation.
π Analysts
Convert HTML reports exported by tools and dashboards into PDFs to share with a team.
βοΈ Marketers
Archive HTML email newsletters and landing pages as PDFs.
π Technical writers
Turn HTML documentation into a PDF manual with bookmarks from its headings.
Common Use Cases
The everyday situations that bring people to this tool.
π§Ύ HTML invoices
Paste an invoice template and get a print-ready PDF to email to a customer.
π° Articles to read later
Save a long article with its pictures as a searchable PDF.
π« Tickets and confirmations
Keep a PDF of a booking or order page that will still open next year.
π Exported reports
Convert test reports, analytics exports and HTML tables to PDF.
π§ Email newsletters
Save the HTML of a newsletter as a PDF for approvals or archives.
π§βπΌ HTML rΓ©sumΓ©s
Turn a rΓ©sumΓ© built in HTML and CSS into a PDF for job portals.
How to Use It on Any Device
Works on every platform, right in the browser. Here are instructions for the most common devices.
πͺ How to convert HTML to PDF on Windows
In Chrome or Edge, open the page, press Ctrl+S and pick βWebpage, Single Fileβ. Drop the .mhtml file here, or drop any .html file directly.
Works on: Windows 10, 11 Β· Chrome, Edge, Firefox
π How to convert HTML to PDF on Mac
In Chrome or Edge press Cmd+S and choose βWebpage, Single Fileβ. Safari saves .webarchive files instead; open the page in Chrome or Edge to save it as .mhtml.
Works on: macOS Β· Chrome, Edge, Safari
π€ How to convert HTML to PDF on Android
Pick an .html file from Files or Downloads in Chrome, or paste HTML code into the Paste tab.
Works on: Android 9+ Β· Chrome
π± How to convert HTML to PDF on iPhone / iPad
Choose an .html file from the Files app in Safari, or paste the code. The PDF saves back to Files.
Works on: iOS 15+ Β· Safari, Chrome
π¦ Saving a page in Firefox
Use βWeb Page, completeβ, then zip the .html file with its folder and drop the .zip here.
Works on: Any browser
Tips & Best Practices
β Save web pages as .mhtml
The single-file .mhtml from Chrome or Edge keeps the page’s pictures and styles, so the PDF matches what you saw.
β Pick the right width
Use Fit to page for documents and invoices, and Desktop width for websites designed for big screens.
β Control page breaks in CSS
Add break-before: page to start a section on a new page, and break-inside: avoid to keep a box together.
β Script-built pages
Content that a page builds with JavaScript only appears if the page was saved after it loaded (an .mhtml saved from the browser includes it).
β Make the PDF smaller
Run the result through Compress PDF if a page has many large photos.
β Combine several pages
Convert each page, then join them with Merge PDF.
Full List of Benefits
More Free PDF Tools
Popular Free Tools
Frequently Asked Questions
Is HTML to PDF free?
Yes. It is completely free, with no signup, no watermark and no limit on files or pages.
Is my HTML uploaded?
No. The page is laid out and converted in your browser. Nothing is sent to a server.
Can I convert a web page from its URL?
For privacy and reliability the page has to come to the tool as a file. In Chrome or Edge press Ctrl+S (Cmd+S on Mac), choose βWebpage, Single File (.mhtml)β, and drop that file here; it keeps the page’s pictures and styles.
Does it run JavaScript?
No. Scripts are never run, for your safety. A page saved as .mhtml from the browser already contains what its scripts built; a raw .html file that relies on scripts may come out incomplete.
Does it support CSS flexbox, grid and web fonts?
Yes. Your own browser lays the page out, so modern CSS works as it does on screen. Web fonts are embedded from the free font library when available; other fonts are replaced with close look-alikes fitted to the same width.
Will text be searchable?
Yes. Text is written into the PDF as real text. Scripts the PDF fonts can’t show, such as Hindi or emoji, are drawn as sharp images so they look right.
How are pages split?
Pages break between lines of text, never through a line, a picture or a table row, and headings stay with the text after them. You can force breaks with break-before: page in CSS.
Why are some pictures missing?
Pictures from other websites can only be copied if that website allows it. Save the page as .mhtml, or put the .html and its pictures in a .zip, to include them.
Can I get one long page instead of A4 pages?
Yes. Choose βOne long pageβ to get the whole page as a single tall PDF page, like a screenshot but with real text.
Do links work in the PDF?
Yes. Web and email links stay clickable, and links to other parts of the page jump to the right place. Headings also become bookmarks.
Can I convert a Safari .webarchive?
Not directly. Open the page in Chrome or Edge and save it as .mhtml, or use File βΊ Export as PDF in Safari.
Is there a size limit?
There is no fixed limit. Very long pages with many photos take longer and depend on your device’s memory.