πŸ”’ Files never leave your device

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.

🌐
Drop an HTML file here
.html, .mhtml (saved web page) or .zip
Searchable PDFΒ·No uploadΒ·No watermark

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:

    1. Open debugspot.com/html-to-pdf
    2. Drop an .html or .mhtml file, or paste HTML code
    3. Choose the page size, margins and layout width
    4. Keep Bookmarks from headings on for long documents
    5. 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.

    1

    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.

    2

    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.

    3

    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.

    4

    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

    βœ“HTML, MHTML and ZIP files, or pasted code
    βœ“Modern CSS laid out by your own browser
    βœ“Real, searchable vector text
    βœ“Words placed exactly where the browser put them
    βœ“Page breaks never cut a line, picture or table row
    βœ“CSS page breaks honoured
    βœ“Clickable links and in-page links
    βœ“Bookmarks from headings
    βœ“A4, Letter, Legal, A3 or one long page
    βœ“Desktop, tablet or phone layout
    βœ“Scripts never run; runs in your browser — never uploaded
    βœ“Free with no signup and no watermark

    More Free PDF Tools

    🧩
    Merge PDF
    Combine several PDFs into one file, in...
    βœ‚οΈ
    Split PDF
    Separate pages or page ranges into ind...
    πŸ—‘οΈ
    Remove Pages
    Delete the pages you don't need and ke...
    πŸ“‘
    Extract Pages
    Pick the pages you need and save them...
    πŸ—‚οΈ
    Organize PDF
    Reorder, rotate, delete and add pages...
    πŸ“²
    Scan to PDF
    Photograph documents with your phone a...
    πŸ—œοΈ
    Compress PDF
    Make PDF files smaller while keeping t...
    πŸ› οΈ
    Repair PDF
    Fix damaged or corrupt PDFs that won't...
    πŸ”
    OCR PDF
    Make scanned PDFs searchable, in 23 la...
    πŸ–ΌοΈ
    JPG to PDF
    Turn JPG, PNG and other images into a...
    πŸ“
    Word to PDF
    Convert Word .docx documents to PDF.
    πŸ“—
    Excel to PDF
    Turn Excel and CSV sheets into neat PD...
    🎞️
    PowerPoint to PDF
    Convert PowerPoint slides to PDF with...
    πŸ“·
    PDF to JPG
    Save every PDF page as a JPG image.
    🎨
    PDF to PNG
    Export pages as lossless, sharp PNG im...
    πŸ“„
    PDF to Word
    Convert text-based PDFs into editable...
    πŸ“Š
    PDF to Excel
    Pull tables out of PDFs into Excel she...
    πŸ“½οΈ
    PDF to PowerPoint
    Turn PDF pages into PowerPoint slides...
    πŸ”€
    PDF to Text
    Extract all the text from a PDF to cop...
    Ⓜ️
    PDF to Markdown
    Clean Markdown with headings, lists an...
    πŸ—„οΈ
    PDF to PDF/A
    Convert PDFs to PDF/A for long-term ar...
    ✏️
    Edit PDF
    Add text, shapes and images to your PD...
    πŸ“‹
    Fill PDF Form
    Fill in PDF forms, tick boxes or type...
    πŸ”„
    Rotate PDF
    Rotate pages the way you need them, on...
    πŸ”’
    Add Page Numbers
    Number your pages with the position an...
    πŸ’§
    Add Watermark
    Stamp text or an image over your PDF p...
    πŸ“
    Crop PDF
    Trim margins or select the area of the...
    πŸ”’
    Protect PDF
    Add a password so only the right peopl...
    πŸ”“
    Unlock PDF
    Remove a password you know from your o...
    ✍️
    Sign PDF
    Draw, type or upload your signature an...
    ⬛
    Redact PDF
    Permanently black out text, numbers an...
    πŸ†š
    Compare PDF
    See every word added or removed betwee...

    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.