Document to PDF Converter

Convert images, HTML, DOCX documents, or plain text to PDF — all in your browser. No upload, no server, no data leaves your device.

Page Size
Orientation
Margin: 10 mm
Output Filename
Advanced Options — PDF Metadata & Password Protection
Applied client-side. Never sent to any server.

Drag & drop images here or click to browse

JPEG, PNG, GIF, WebP, BMP, SVG — select multiple for a multi-page PDF

Image fit mode:

    Drag & drop an HTML file here or click to browse

    Accepts .html and .htm files

    Drag & drop a DOCX file here or click to browse

    Accepts .docx (Office 2007+). Legacy .doc binary format is not supported in the browser.

    About This Tool

    Converting documents and images to PDF is one of the most frequent tasks in professional and development workflows. PDF (Portable Document Format) preserves layout, fonts, and formatting across operating systems, devices, and software, making it the universal standard for sharing finished documents, reports, invoices, and reference materials.

    This free online tool handles three common input formats: raster and vector images (JPEG, PNG, GIF, WebP, BMP, SVG), HTML files, and DOCX Microsoft Word documents. All processing runs entirely client-side in your browser using JavaScript. No file is ever uploaded to a server, which means your documents remain completely private and the conversion works without an internet connection once the page has loaded.

    The tool uses three well-established open-source JavaScript libraries: jsPDF for constructing PDF documents, html2canvas for rendering HTML content into a canvas element, and mammoth.js for parsing DOCX file structure. Together they cover the most common document-to-PDF scenarios developers and non-technical users encounter daily.

    How Each Conversion Works

    Images to PDF

    Each selected image file is read by the browser's File API and drawn onto an HTML canvas element. The canvas step normalises all image formats (including GIF and WebP, which jsPDF does not natively encode) into PNG data before embedding. The image is then proportionally scaled to fit within a standard A4 page (210 x 297 mm) with a small margin, centred on the page. When multiple images are selected, each one is placed on its own page in the same PDF document, preserving the order in which files were selected.

    HTML to PDF

    The uploaded .html file (or pasted HTML) is injected into a hidden rendering container at A4 width (794 px, which corresponds to 210 mm at 96 DPI). The html2canvas library then traverses the rendered DOM and paints each element onto a canvas, effectively taking a pixel-accurate screenshot of how the browser interprets the HTML and CSS. That canvas image is embedded into jsPDF, and the page height adjusts to match the rendered content. This approach handles inline styles, embedded CSS, tables, lists, and basic layouts well.

    DOCX to PDF

    A .docx file is a ZIP archive containing XML documents. The mammoth.js library unpacks that archive in memory and converts the Word XML into clean semantic HTML. The generated HTML is rendered by html2canvas at A4 width, then automatically paginated across multiple A4 pages within jsPDF. Plain text, headings, bold and italic formatting, numbered and bulleted lists, hyperlinks, and simple tables all convert reliably through this pipeline.

    Legacy .doc files use a closed binary format that is not parseable by browser JavaScript libraries. If you have a .doc file, open it in Microsoft Word or LibreOffice and save it as .docx first, then use this tool.

    Text to PDF

    The Text to PDF tab converts plain text directly using jsPDF’s built-in text renderer, bypassing html2canvas entirely. The result is a genuinely text-searchable, copy-pasteable PDF — the text is embedded as vector characters in the PDF structure rather than rasterised into an image. Choose from Helvetica, Times New Roman, or Courier, set font size from 8 pt to 24 pt, and adjust line spacing. Long paragraphs are word-wrapped automatically to fit within the page’s content area, and the document paginates across multiple pages when text overflows.

    Limitations and Browser Compatibility

    Browser-based conversion is not equivalent to a dedicated PDF typesetting engine. Several scenarios will produce output that differs from the source document:

    • Complex HTML layouts — Multi-column CSS Grid or Flexbox layouts, sticky or fixed headers, and custom web fonts loaded from external URLs may not render accurately because html2canvas works on the live rendered DOM within the page context.
    • DOCX advanced features — Embedded charts, SmartArt graphics, equation editor content, macros, tracked changes, comments, and password-protected documents are not supported by mammoth.js and will be omitted from the output.
    • Image resolution — Low-resolution source images will appear soft or pixelated if scaled up to fill an A4 page. Use source images of at least 1240 x 1754 px for a full-page A4 image at 150 DPI.
    • Text searchability — All output from this tool is image-based PDF. The content is not text-selectable or indexed by search engines within the PDF. For fully searchable output from DOCX, use the native "Save as PDF" export in Word or LibreOffice.

    The tool works in all modern browsers: Chrome 90+, Firefox 88+, Edge 90+, and Safari 14+. The generated PDF files are standards-compliant and open in Adobe Acrobat, browser PDF viewers, Apple Preview, and all major third-party readers including Foxit and Okular.

    Frequently Asked Questions

    Are my files uploaded to a server when using this tool?

    No. All conversions happen entirely in your browser using JavaScript. Your files are never sent to our servers and remain private on your device. The PDF password, metadata, and document contents never leave your machine.

    Why does my DOCX output look different from the original Word document?

    DOCX-to-PDF conversion uses the open-source mammoth.js library, which extracts text and basic formatting from the Word XML structure. Complex elements such as embedded charts, SmartArt, custom fonts, tracked changes, footnotes, and multi-column layouts are not supported in the browser. For pixel-perfect results, use Microsoft Word or LibreOffice to export directly to PDF from the application.

    Can I combine multiple images into one PDF?

    Yes. Select or drag-and-drop multiple image files into the Images tab. Each image becomes one page. Use the up and down arrow buttons in the image list to reorder pages before converting.

    What is the maximum file size this tool supports?

    There is no enforced size limit, but files larger than 20 MB may process slowly because all conversion runs in the browser using your device's available RAM. For large DOCX documents or high-resolution images, allow several seconds for processing to complete.

    Does the Text to PDF tab produce a searchable PDF?

    Yes. The Text to PDF tab uses jsPDF's native text renderer, which embeds the text content directly into the PDF structure. The output is fully text-searchable and copy-pasteable in any PDF reader, unlike the image-based output produced by the Images, HTML, and DOCX tabs.

    Can I password-protect the generated PDF?

    Yes. Expand the Advanced Options section and enter a password in the Password Protection field. The password is applied using jsPDF's built-in encryption, which runs entirely in the browser. The password is never sent to any server. Recipients will be prompted to enter the password when opening the file in any standard PDF reader.

    Which page sizes and orientations are supported?

    The tool supports A4 (210 x 297 mm), A3 (297 x 420 mm), US Letter (8.5 x 11 inches), and US Legal (8.5 x 14 inches) in both portrait and landscape orientation. These settings apply to all four conversion tabs. The margin slider adjusts the content inset from 0 mm to 25 mm.

    Does this tool work on mobile devices and tablets?

    Yes. The tool runs on any device with a modern browser, including Android and iOS. File upload and PDF generation work on mobile. On some mobile browsers the PDF may open inline in the browser viewer rather than triggering an automatic file download.