How to Convert HTML Files to PDF Locally (No Server, No Code)
Convert local HTML files to properly formatted PDF documents without uploading to any server. Supports CSS styling, images, and links — all processed in your browser for free.
TL;DR
To convert HTML files to PDF without a server: install Convert: Anything to PDF, click the icon, drag in your HTML file, and download. The HTML is rendered with its CSS styling and converted to a formatted PDF — all locally in your browser.
Who needs HTML-to-PDF conversion?
HTML-to-PDF is a surprisingly common need across different roles:
- Developers — Converting HTML reports, email templates, and generated pages to PDF for review
- Email marketers — Saving HTML email drafts as PDFs for approval before sending
- Web designers — Creating PDF proofs of static HTML mockups
- Data teams — Converting HTML reports generated by analytics tools, Jupyter notebooks, or R Markdown
- Documentation writers — Converting HTML docs to PDF for offline distribution
- Students — Saving downloaded HTML lecture notes as properly formatted PDFs
The standard approaches and their problems
Opening in a browser and printing
You can open an HTML file in Chrome and use Ctrl+P. But this applies the print media stylesheet (if any), breaks some layouts, and gives you no control over element removal or content cleanup.
wkhtmltopdf (command line)
A popular CLI tool that renders HTML to PDF. Requires installation, works from the command line, and is powerful but not accessible to non-technical users. It also has not been actively maintained and struggles with modern CSS.
Online HTML-to-PDF converters
Websites that accept HTML file uploads and return PDFs. These upload your HTML (and any embedded content) to external servers. For HTML containing sensitive data, credentials, or internal information, this is a privacy concern.
Headless Chrome / Puppeteer
The developer approach — running Chrome headlessly to render HTML and output PDF. Requires Node.js, Puppeteer, and scripting knowledge. Overkill for one-off conversions.
The simple approach: browser extension
Convert: Anything to PDF renders your HTML file in the browser (which already knows how to display HTML perfectly) and converts the rendered output to PDF.
How it works
- Click the extension icon and select "Upload Files"
- Drag and drop your .html file
- The extension renders the HTML using Chrome's rendering engine
- CSS styles, fonts, images (with local or embedded paths), and formatting are preserved
- Choose paper size (A4, Letter, Legal) and orientation
- Download the PDF
What gets preserved
- CSS styling — Colors, fonts, spacing, borders, backgrounds
- HTML structure — Headings, paragraphs, lists, tables
- Embedded images — Images referenced by relative paths or data URIs
- Links — Hyperlinks remain clickable in the PDF
- Tables — HTML tables render as formatted tables in the PDF
Limitations
- External resources (images linked to remote URLs) may not load if you are offline
- Complex JavaScript-dependent rendering may not execute (the file is rendered as static HTML)
- CSS print media queries may override screen styles
Common use cases
Converting HTML reports
Many analytics tools, BI platforms, and data pipelines output HTML reports. To share these with stakeholders who expect PDFs:
- Export the report as HTML from your tool
- Drag it into Convert: Anything to PDF
- Download a properly formatted PDF
Saving HTML email templates
Before sending an HTML email campaign, you may want a PDF proof for approval:
- Save the HTML email template to your computer
- Drag it into the extension
- The email renders with its inline CSS styling
- Download the PDF to share with your team
Converting downloaded web pages
If you saved a web page as HTML (Ctrl+S in the browser), you can convert the saved file to PDF:
- Locate the saved .html file on your computer
- Drag it into the extension
- Download as PDF
Merging HTML with other files
You can combine HTML files with images, CSV files, and Markdown in a single PDF:
- Drag an HTML cover page + a CSV data table + an image chart into the extension
- They merge into one PDF document
Comparison: HTML-to-PDF methods
Convert: Anything to PDF:
- Setup: Chrome extension (5 seconds)
- Upload to server: No
- CSS support: Yes (screen rendering)
- Technical knowledge: None
- Cost: Free
Open in browser + Ctrl+P:
- Setup: None
- Upload to server: No
- CSS support: Yes (print rendering — may differ from screen)
- Technical knowledge: None
- Cost: Free
wkhtmltopdf:
- Setup: CLI installation
- Upload to server: No (local)
- CSS support: Partial (older WebKit engine)
- Technical knowledge: Command line required
- Cost: Free
Online converters:
- Setup: None
- Upload to server: Yes
- CSS support: Varies
- Technical knowledge: None
- Cost: Free with limits
Puppeteer / Headless Chrome:
- Setup: Node.js + scripting
- Upload to server: No (local)
- CSS support: Full (Chrome engine)
- Technical knowledge: Developer-level
- Cost: Free
Frequently asked questions
Does it support CSS?
Yes. The HTML file is rendered using Chrome's rendering engine, which supports modern CSS including flexbox, grid, custom properties, and web fonts. The rendering is the same as opening the file in Chrome.
Can I convert HTML with JavaScript?
Static HTML with inline styles and content converts well. JavaScript that needs to execute to render content (like React or Angular apps) may not fully render because the extension processes the file as a static document.
What about HTML email templates with inline CSS?
HTML emails use inline CSS extensively. The extension handles inline CSS perfectly — this is one of its strongest use cases.
Can I convert multiple HTML files into one PDF?
Yes. Drag and drop multiple HTML files into the extension. Each file is rendered and added as a section in the merged PDF.
Bottom line
HTML-to-PDF conversion does not need a command line, a server, or developer tools. Convert: Anything to PDF renders your HTML with full CSS support and converts it to a clean PDF — locally, instantly, and free. Drag your file in and download.
Try our free Chrome extensions
Privacy-first tools that actually work. No paywalls, no tracking, no data collection.