jsPDF
An open-source JavaScript library for generating PDF documents in the browser. It can create PDFs from scratch or render HTML content into PDF pages, all without server-side processing.
Convert HTML markup into a formatted PDF document. Supports headings, tables, lists, code blocks, and styling — free, instant, and private in your browser.
Preview will appear here as you type...
HTML to PDF Converter transforms HTML markup into a professionally formatted PDF document. Paste any HTML — from simple paragraphs to complex layouts with tables, lists, and styled elements — and download a print-ready PDF instantly. Handles long documents with automatic page breaks and chunked rendering. The conversion uses jsPDF and html2canvas, running entirely in your browser with no server upload.
Essential terms and definitions related to HTML to PDF Converter.
An open-source JavaScript library for generating PDF documents in the browser. It can create PDFs from scratch or render HTML content into PDF pages, all without server-side processing.
The converter supports headings (h1-h6), paragraphs, bold/italic/underline text, ordered and unordered lists, tables with headers, code blocks and inline code, blockquotes, links, images (base64 or accessible URLs), and horizontal rules.
The converter applies a clean, print-optimized stylesheet automatically. Inline styles on HTML elements are partially supported. For best results, use standard semantic HTML and let the converter handle the styling.
A4, Letter, and Legal page sizes in both portrait and landscape orientation. You can also adjust margins (10-25mm) and base font size (9-14pt).
Images referenced by URL are included if they are accessible from your browser (same-origin or CORS-enabled). For guaranteed inclusion, use base64-encoded images directly in the HTML.
Common errors developers encounter and how to resolve them.
External images missing from the output PDF Remote images require CORS headers to be readable by the canvas renderer. Use base64-encoded data: URIs for guaranteed inclusion, or serve images from a CORS-enabled endpoint (same-origin or with Access-Control-Allow-Origin: *).
Custom CSS from <link> tags not applied Only inline styles and the built-in print stylesheet are respected. External stylesheets loaded via <link rel="stylesheet"> are ignored. Inline your critical styles using the style attribute or a <style> block inside the HTML input.
Table columns overflow the page width Switch page orientation to landscape, reduce base font size, or break wide tables into multiple narrower ones. Unlike browsers, PDF pages have a fixed width — content cannot scroll horizontally, so long tables will be clipped.
Web fonts (Google Fonts, @font-face) not rendering jsPDF only embeds the standard PDF base fonts (Helvetica, Times, Courier). Web fonts are not bundled into the output. Use a similar built-in font, or rasterize the HTML with a tool that supports font embedding before conversion.