HTML to PDF
Paste HTML into a text box and the tool draws it in a hidden A4-width container, captures it as an image, and cuts that image into A4 pages of a downloadable PDF. The result is a picture of the page, so the text in the PDF is not selectable.
HTML to PDF Converter
Convert HTML code to PDF documents, entirely in your browser.
Notes:
- Renders your HTML and basic CSS to a multi-page PDF
- Runs 100% in your browser ā no upload, no server
- Complex CSS layouts (flex/grid) may render approximately
- JavaScript in the HTML is not executed
How to Use
- 1Paste your HTML into the 'HTML Code' box. You can paste a whole document or just a fragment; there is no file upload.
- 2Click Convert to PDF. The button stays disabled while the box is empty.
- 3Wait for 'Processing...' to finish; the browser downloads a file named converted.pdf automatically.
- 4Open the PDF and check page breaks and layout, then adjust the HTML and convert again if needed.
Features
- Input is pasted HTML code in a text box; there is no file upload and no page-count limit stated in the code
- If your HTML contains a body element, only the contents of the body are rendered
- Rendered at about A4 width (794 px) with 24 px padding, Arial as the default font, on a white background
- Output is A4 pages made from a JPEG image of the render, so text cannot be selected or searched
- JavaScript in the pasted HTML is not executed
- Runs in your browser; the HTML is not sent anywhere
FAQ
Which HTML and CSS actually work?
The page is rendered by html2canvas, which redraws HTML and CSS itself rather than using the browser's print engine. Ordinary text, headings, lists, tables, colours, borders, fonts available on your device and inline or in-body style rules work. Flexbox and grid usually render but may be approximate, and some features such as certain filters, blend modes and pseudo-element tricks do not. Page-break CSS (page-break-before, break-inside) is ignored.
Why does a full HTML document lose its styles?
When your pasted code has a body tag, the tool keeps only what is inside the body. A style block in the head is discarded. Put your style tags inside the body, or use inline styles, and the CSS will be applied.
Can I select or copy the text in the resulting PDF?
No. The page is captured as an image and each A4 slice is placed into the PDF as a JPEG, so the PDF contains no text layer. Links are not clickable either, and file size grows with the length of the content. If you need searchable text, run the result through OCR PDF.
Where does the page break fall, and do images load?
Pages are simply cut every A4 height, so a line of text or an image can be sliced in half at a page boundary. Images load only if their address is reachable from your browser and allows cross-origin use; images on other sites that block that will be missing. Very long content may fail because browsers limit the size of a canvas.
Is my HTML uploaded?
The rendering and PDF creation happen in your browser and the tool does not send your HTML anywhere. Note that any external images or fonts referenced in your HTML are fetched by your browser from those addresses.