HTML to PDF

Turn an HTML file into a paginated PDF, at the page size, orientation and margin you set.

Secure server processingPDFWorkingNo account needed

What this tool does

HTML to PDF sends your file to LibreOffice running headless on the processing service, which imports the markup as a document and writes it out through its PDF export filter. Files ending .html, .htm, .md and .txt are accepted, and the PDF comes back carrying the source file's name. Convert one file per run, though: the picker will let you select several, and the job then renders only the first of them and drops the rest without saying anything, so start a fresh run for each document rather than adding them all at once.

The engine behind this markup to PDF conversion is a document importer, not a browser, and that is the limit worth understanding before you rely on the output. LibreOffice reads structure and basic styling — headings, paragraphs, lists, tables, links, inline and embedded CSS for colour, weight and alignment — and the finished job says so in its own notes. Modern CSS layout is a different matter: flexbox and grid positioning, web fonts and anything a script would have written into the page will not come through the way Chrome or Safari draw them. When the design is the point, your browser's own print-to-PDF renders the page with the engine that laid it out; when the content is the point, this route gives you a clean, text-selectable PDF without opening anything.

Only the file itself is uploaded, which shapes how you should prepare it. A stylesheet, image or font sitting next to the document on your disk is not sent with it, so anything referenced by a relative path is simply missing from the render — inline the CSS into a style block in the head and embed images as data URIs, and a single self-contained file behaves predictably. The .md and .txt extensions are accepted as convenience, not as a Markdown feature: there is no Markdown parser anywhere in this path, so a heading written as # stays a literal hash. Markdown Preview renders that properly and you can print from there.

Page size, orientation and margin are applied as a real @page rule that is injected into the document before it reaches LibreOffice. Explicit millimetre dimensions are written rather than names, because LibreOffice's HTML import ignores "size: A3" and quietly renders A4 — so A4 becomes 210 by 297, US Letter 216 by 279 and A3 297 by 420, swapped when you pick landscape. Margins are clamped into the nought-to-60 mm range, and because the injected rule goes in first, a document carrying its own @page rule later on will override what you chose here. Background printing and footer page numbers are not offered at all, since the HTML import exposes no way to honour them; run the finished file through Add Page Numbers if you need folios. The work happens on the server: your file travels over an encrypted connection, uploads are capped at 200 MB, a render is stopped if it passes two minutes, and the upload is erased the moment the render finishes — should the job fail instead, it waits for the same periodic sweep that clears the returned PDF and the job record holding your settings once the job expires.

How to use it

  1. Make the file self-contained. Inline the stylesheet and embed images as data URIs. Only the file you choose is uploaded, so linked assets on your disk will not be part of the render.
  2. Add one file. A single .html, .htm, .md or .txt file, up to 200 MB. Choosing several in one go still returns only the first as a PDF, so convert the next one in its own run.
  3. Set the page size, orientation and margin. A4, US Letter or A3, portrait or landscape, and a margin in millimetres — 15 by default, and anything above 60 is clamped to 60.
  4. Run the render and open the result. Two minutes is the ceiling for a job. Check any table or multi-column section first, since that is where a document importer diverges from a browser.

Processing & privacy

Secure server processing. This operation requires temporary server processing.

Common use cases

An invoice or report from a system that only exports HTML

Billing tools, analytics dashboards and internal admin screens often emit markup and nothing else. This gives you the attachment the recipient expects.

Documentation or release notes written in plain HTML

A hand-written page of headings, lists and tables is exactly the kind of structure the importer handles well, and it paginates cleanly.

Sending someone a page they will not open as .html

An HTML attachment triggers a security warning in plenty of mail clients and opens in a browser rather than a reader. A PDF avoids both.

Filing a saved confirmation or receipt page

A one-file save keeps for years as a PDF, where an HTML copy depends on assets and a stylesheet that may have moved on.

Questions

Is my HTML file uploaded?
Yes. LibreOffice does the rendering on the processing service, so the file is sent there over an encrypted connection and converted. The upload itself is erased as soon as the render finishes, and the PDF it produced is cleared along with the job record when the job's short retention window runs out.
Will the PDF look like the page does in my browser?
Not exactly. This is LibreOffice's HTML import rather than a browser engine, so structure and basic styling carry over while flexbox and grid layout, web fonts and script-generated content do not. For a page whose appearance matters more than its text, print it to PDF from the browser that already renders it correctly.
Can I paste markup instead of choosing a file?
Not on this page — it takes a file rather than a text box. Save what you have as an .html file first, then add that; the render is the same either way.
Do external stylesheets, images and web fonts load?
Anything referenced by a relative path is not there, because only the single file you choose is uploaded. Inline the CSS and use data URIs for images to get a render that matches what you intended.
Does it run JavaScript?
No. The markup is imported as a document, so anything a script would have built at load time — a chart, a table filled from an API, content revealed on scroll — is absent from the PDF.
Are Markdown files converted as Markdown?
No. A .md file goes through the same HTML importer as everything else, so Markdown syntax arrives as literal characters rather than headings, bold text and lists.
Why did my page size or margin not take effect?
The settings are written as an @page rule placed at the start of the document, so a rule of your own further down the document wins on the cascade. Margin values are also clamped before they are written: above 60 mm becomes 60, and below zero becomes zero.
Can I convert several HTML files at once?
No, and the job does not warn you when you try. Selecting more than one file returns a single PDF made from the first, with the others discarded, so give each document its own run and bind the results with Merge PDF if you want them in one file.

Related tools

  • Merge PDF — Combine several PDFs into one document in the order you choose.
  • Split PDF — Split one PDF into separate documents by page range.
  • Compress PDF — Reduce PDF file size while preserving the quality that matters.
  • PDF to JPG — Export every page of a PDF as a JPG image.
  • JPG to PDF — Turn one or many JPG photos into a single PDF.
  • Protect PDF — Add a password and set permissions on a PDF.