What This Tool Does
The HTML to PDF Converter turns raw HTML markup or a live web page into a PDF, keeping headings, text formatting, tables, images and CSS styling in place. Choose a paper size and margins, add a running header and footer with automatic page numbers, and check exactly where each page will break before you convert.
How to Convert HTML to PDF
- Provide the HTML: Paste a full HTML document or a snippet into the HTML Code tab, or switch to the URL tab and fetch a live page.
- Choose paper size and orientation: Pick Letter, A4 or Legal, and Portrait or Landscape.
- Set margins: Normal, Narrow, Wide or None, depending on how tight you want the layout.
- Add a header and footer (optional): Enter text for the top and bottom of every page. Use
{page}and{pages}in the footer for automatic page numbering, e.g.Page {page} of {pages}. - Add print CSS (optional): Paste extra CSS to adjust fonts, colors or spacing specifically for the PDF output, on top of any styles already in the HTML.
- Preview page breaks: Click Preview page breaks to see the rendered content with dashed lines marking where each page will split.
- Convert and download: Click Convert to PDF, then download the file.
Converting HTML Code
Paste a complete HTML document (including <style> tags) or just a body snippet. Any inline styles or <style> blocks in your markup, including @media print rules, are honored by the renderer, so a page built with a dedicated print stylesheet will come through as intended.
Converting a URL
Switch to the URL tab, enter a page address and click Fetch. Your browser requests the page directly - the request never passes through our servers. Many sites block this kind of direct, cross-origin fetch for security reasons (the same protection that stops any website from silently reading another site's content). If a fetch fails, open the page yourself, use your browser's View Page Source or Save Page As → Webpage, HTML only, and paste that markup into the HTML Code tab instead.
Headers, Footers and Page Numbers
Header and footer text is printed on every page of the output at the top and bottom margin. Use the placeholders {page} for the current page number and {pages} for the total page count - for example Confidential - Page {page} of {pages} - and they're filled in automatically once the full document has been paginated.
Page-Break Preview
Click Preview page breaks to render your HTML at the chosen paper size and margins, with dashed lines overlaid at each point a new PDF page will start. This makes it easy to spot an image or table that gets awkwardly split across two pages before you generate the final file.
Privacy & Security
Pasted HTML is never uploaded - it's rendered and converted to a PDF entirely inside your browser. When you convert a URL, your browser fetches that page directly; the request goes from your device to the target site, not through any server we control, and the resulting page is likewise rendered and converted locally.
Frequently Asked Questions
Will the PDF match the page pixel-for-pixel?
It will be close for most standard HTML and CSS, but the renderer reconstructs layout on a fixed page size rather than replicating a full browser's print engine, so very complex CSS (grid-heavy layouts, custom fonts loaded from restricted origins, JavaScript-rendered content) may reflow slightly.
Can it convert pages that require login?
No. The URL tab can only fetch publicly accessible pages that allow cross-origin requests. For anything behind a login, save the rendered page as HTML from your browser and paste it into the HTML Code tab.
Does it run JavaScript on the page?
No. The tool renders the HTML and CSS you provide as markup; it does not execute page scripts, so content that's injected by JavaScript after load won't appear. Copy the page's rendered HTML (via your browser's "Save Page As" or "Inspect" panel) if you need that content included.
Is there a size limit?
No artificial limit - the practical limit is your device's memory, since everything is processed locally. Very long documents or image-heavy pages will take longer to render.