Convert HTML to PDF — save web pages as portable documents
Drop an HTML file below and get a multi-page PDF back. Runs entirely in your browser via html2canvas and pdf-lib, with no upload and no third-party service.
Your file is processed entirely in your browser. Nothing is uploaded.
HTML is the format of the live web, but PDFs are the format of archives. Every time you want to save a web page for offline reading, a receipt from an online order, an HTML email you wish to keep, or a static-site article for reference, converting HTML to PDF is the right move. The PDF preserves the visual layout, can be emailed as a single file, uploaded to portals that require PDFs, and read years later on any device without depending on the original website still existing.
This converter reads your HTML file locally, parses it into a DOM, and renders the body content into a hidden A4-width container. html2canvas captures the rendered content as a full-height canvas, which is then sliced into page-sized chunks and embedded into a new PDF via pdf-lib. JavaScript in your source HTML is not executed — only the static markup and CSS are rendered. The result is a faithful snapshot of how the HTML looks in a browser, turned into a multi-page PDF ready for archiving or sharing.
How to convert HTML to PDF in 4 steps
- 1
Select your HTML file
Drop the .html or .htm file into the dropzone or click to browse. Any HTML file with standard markup is accepted.
- 2
Let the browser render the content
The HTML is loaded into a hidden A4-width container where the browser applies its own styling and layout. External images work if they are accessible.
- 3
Capture and paginate
html2canvas renders the container as a large canvas, then the tool slices it into A4-sized pages and embeds each page into a new PDF.
- 4
Download the PDF
Save the PDF to your device. Your HTML file is untouched, the PDF is self-contained, and nothing has been uploaded anywhere.
HTML vs PDF: live page versus archived document
HTML and PDF are both document formats but they solve different problems. HTML is optimized for the live, dynamic web — it can reflow on different screen sizes, execute scripts, respond to user actions, and link to other pages. PDF is optimized for freezing a visual layout in time — every pixel is fixed, no scripts run, no reflow happens, and the file can be archived, printed, or shared as a single downloadable asset. Converting HTML to PDF is the natural step when you want to preserve a web page exactly as it looked at a moment in time. It works especially well for static content (articles, receipts, reports, HTML emails) and less well for highly dynamic pages (single-page apps, anything that depends on JavaScript to render).
When should you convert HTML to PDF?
Saving an article for offline reading
Articles, blog posts, and long-form writing often outlast the websites that host them only if someone saved them. A PDF archive works decades later, regardless of the original site.
Archiving receipts from online orders
Many e-commerce platforms send HTML receipts via email. Converting to PDF gives you a permanent record for expense reports or tax filings.
Saving an HTML email for compliance records
Some regulated industries require permanent records of communications. Converting an HTML email export to PDF creates an archive-friendly document.
Turning a static-site page into a shareable document
If you maintain a static site and need to hand a page to someone offline or as a single file, HTML to PDF is the fastest path without rebuilding the content in another tool.
Frequently asked questions
- Does the tool execute JavaScript in my HTML?
- No. The HTML is rendered as static markup — no scripts run. If your page depends on JavaScript to display content (like a React app), the PDF will only show whatever is in the initial HTML, not the JS-rendered output. For JS-heavy pages, save the fully-rendered HTML first from DevTools.
- Are external images loaded?
- Yes, if the image URLs are publicly accessible and CORS-friendly. Images hosted on the same domain as the HTML file work reliably. Images from cross-origin hosts that block CORS may not render in the PDF.
- Is the CSS preserved?
- Inline <style> blocks and styles embedded in the HTML are preserved. External stylesheet links may or may not work depending on CORS and network access. For best results, inline your CSS into the HTML before converting.
- How does pagination work?
- The rendered content is captured as one tall canvas, then sliced into A4-sized pages and embedded into the PDF. Content is not broken mid-paragraph in a smart way — slicing happens at fixed pixel boundaries, so a paragraph can start at the bottom of one page and continue at the top of the next.
- Is my HTML uploaded?
- No. The conversion runs entirely in your browser through html2canvas and pdf-lib. Your HTML is read locally, rendered locally, and the PDF is produced locally. FileShrink has no server that touches your files.