Skip to content
ToolsOnDuty - free online tools

Search tools

Loading tool search...

PDF Tools

HTML to PDF

Convert HTML into a downloadable PDF with a live preview.

Free browser toolRuns in your browserNo sign-up

HTML document studio

Design and preview an HTML PDF

Write sanitized HTML, keep the rendered document visible while editing and create a private A4 PDF in the browser.

412

characters

A4

page format

Sanitized

live preview

Live document preview

Invoice

Dear customer, thank you for your order.

ItemPrice
Widget$19.00

Private workspace. Files stay in this browser tab and are never uploaded to ToolsOnDuty.

External scripts do not run. Long content is split across A4 pages.

About the HTML to PDF

HTML to PDF renders pasted markup in a sanitized live preview and captures that preview into portrait A4 pages. It is intended for self-contained snippets such as invoices, notices, tables, and simple reports rather than fetching a public web address.

Basic markup, tables and allowed inline styling can appear in the sanitized preview. Scripts and unsafe embeds are removed, and unsupported styles can disappear. Prefer self-contained HTML with embedded image data; allowed external image or CSS references may cause browser requests, so remove them before previewing confidential content.

The rendered preview is captured as a PNG image and sliced across PDF pages. The result is rasterized: text is not selectable, semantic links are not retained, and awkward page breaks can occur through tall elements.

Key features

  • Editable HTML source area
  • Sanitized live document preview
  • Portrait A4 multi-page output
  • Basic inline styles and tables
  • Script and unsafe embed removal
  • Local canvas rendering and PDF creation
  • No remote-URL fetching

How to use

  1. 1Paste or write self-contained HTML in the source editor.
  2. 2Use simple inline styles and embedded image data. Remove external resource references before previewing private content.
  3. 3Review the sanitized preview and confirm that unsupported content was not removed unexpectedly.
  4. 4Keep very tall unbreakable elements out of likely page boundaries.
  5. 5Convert to PDF and inspect the downloaded A4 pages.

Examples

Create a simple invoice
Input: HTML with heading, address, item table, and total
Output: Rasterized multi-page A4 PDF

Review table rows near page boundaries before sharing.

Frequently asked questions

Can it convert a website URL?
No. It converts pasted HTML and does not fetch remote web pages.
Do scripts run?
No. Scripts, event handlers, iframes, and unsafe embeds are removed from the preview.
Is the PDF text selectable?
No. The rendered preview is captured as an image and placed on PDF pages.
Are external styles guaranteed to load?
No. Sanitization can remove unsupported markup or styles, and external resources depend on browser and cross-origin rules. Use self-contained HTML and check the actual preview.
What limits very long documents?
The browser must capture the complete preview to one canvas, so canvas dimensions and device memory set practical limits.
Does local processing mean there are no network requests?
The conversion runs locally and does not fetch a website URL for you. Allowed external resource references in pasted markup can still make the browser request those resources; use embedded images and remove external references for confidential snippets.

Open a related tool to prepare your files or refine the finished result.