Convert HTML to PDF
With MyLovePDF you convert HTML code to a PDF for free and without signing up. You paste the code or load an HTML file, choose page size and orientation, and get the PDF. The conversion runs in a browser without internet access on our server in Frankfurt am Main. That is why images, fonts and scripts from the internet are not loaded: everything that should appear in the PDF has to be inside the code itself. The code is deleted after 60 minutes at the latest.
File up to 2 MB. The content appears in the box and can be edited.
How to convert HTML to a PDF
- 1
Paste HTML or load a file
Paste the HTML code into the box or click “Load HTML file”. Up to 2 MB are allowed.
- 2
Choose the format
Choose A4 or Letter and portrait or landscape. Your own @page rules in the code take precedence.
- 3
Convert to PDF
Click “Convert to PDF”. The code is transferred to the server and printed to a PDF there.
- 4
Download and check the PDF
Download the PDF and check layout, umlauts and images.
What you can expect from the conversion
- Modern rendering
- The PDF is printed with a current browser. CSS such as flexbox, grid and @page rules is taken into account.
- Safe through isolation
- The browser has no internet, runs no scripts and may only open your document. Foreign addresses are never called.
- Images inside the code
- Images and fonts have to be data: addresses in the code. That makes the result independent of other servers.
- Server in Frankfurt, quick deletion
- Your code is processed in Germany and deleted after 60 minutes at the latest. No account is needed.
Typical uses
- Invoices and offers: An HTML template from your system becomes a PDF to send.
- Reports and résumés: Documents styled with CSS get a fixed page layout.
- Documentation: Single pages or manuals as a PDF to pass on.
What the conversion can and cannot do
| Topic | Note |
|---|---|
| HTML and CSS | Printed with a current browser, including flexbox, grid and @page |
| Images | Only as data: addresses in the code |
| Fonts | System fonts of the server, embedded fonts as data: |
| JavaScript | Switched off |
| Internet addresses | Are not called |
| Size | Up to 2 MB of code |
| Retention | The code is deleted from the server after 60 minutes at the latest |
Tips
- Control page breaks: With
page-break-beforeorbreak-afterin your CSS you decide where a new page starts. - Use print CSS: Rules in
@media printapply during the conversion. - Embed images: Convert images to data: addresses so that they appear in the PDF.
- Shrink or protect afterwards: With Compress PDF or Protect PDF you process the result further.
Frequently asked questions about HTML to PDF
How do I convert HTML to a PDF?
Paste the HTML code or load a file, choose the format and click “Convert to PDF”. Then download the PDF.
Can I convert a web page by its address?
No. For security reasons we only accept HTML code, not addresses. Save the page in your browser as an HTML file or copy the code, and load it here.
Why are my images and fonts missing?
The conversion has no access to the internet. Images and fonts from other sources are not loaded. Embed images as data: addresses directly in the code.
Are scripts executed?
No. JavaScript is switched off. Content that is only created by scripts does not appear in the PDF.
Which page sizes are available?
A4 and Letter, each in portrait or landscape. With an @page rule in your CSS you can set the format yourself.
How large can the code be?
Up to 2 MB. That is enough for text, tables and embedded images of usual size.
Is my code uploaded?
Yes. The conversion does not run in the browser, so we transfer the code to our server in Frankfurt am Main. It is deleted after 60 minutes at the latest.
Is HTML to PDF free?
Yes. The conversion is free, with no sign-up and no watermark.
Also searched as
- HTML to PDF
- convert HTML code to PDF
- HTML file to PDF
- web page to PDF
- HTML PDF converter
- HTML invoice to PDF
Updated on
More PDF tools
- Merge PDFCombine several PDFs into one file in the order you want.
- Split PDFSplit a PDF by page ranges or extract the pages you need.
- Add pagesInsert blank pages or pages from another PDF anywhere.
- Remove PDF pagesRemove single pages from a PDF and save a new file.
- Extract PDF pagesTake selected pages of a PDF into a new file.
- Rotate PDFTurn the pages of a PDF to the right or left and save it.
- Organize PDFMove, rotate and delete the pages of a PDF.
- Crop PDFCut off the margins of a PDF, for all or selected pages.
- Page numbersAdd page numbers to a PDF: choose position, format and start number.
- WatermarkPut a text or an image over a PDF as a watermark.
- Sign PDFDraw, type or upload a signature and add it to a PDF.
- Redact PDFMark confidential passages in a PDF and remove them for good.
- PDF formsDetect fillable fields in a PDF, fill them in and save.
- Protect PDFEncrypt a PDF with a password and set whether printing and copying are allowed.
- Unlock PDFRemove the password and restrictions from a PDF when you know the password.
- Repair PDFRepair a damaged PDF so that it opens again.
- Make PDF searchable (OCR)Make a scanned PDF searchable and copyable with text recognition.
- PDF to PDF/AConvert a PDF to the long-term archive format PDF/A-2b.
- Compare PDFCompare two PDF versions page by page and find the changes.
- PDF to MarkdownTurn a PDF into a Markdown file, with headings, lists and tables.
- Scan to PDFPhotograph documents with your camera and save them as a PDF.
- PDF to WordConvert PDF files into an editable Word document (DOCX).
- PDF to PowerPointTurn PDF pages into slides of a PowerPoint presentation (PPTX).
- PDF to ExcelExtract tables from a PDF and save them as an Excel file (XLSX).
- Edit PDFAdd text, images, shapes and drawings to a PDF and save it.
- Compress PDFMake PDF files smaller so they are easier to send and store.
- JPG to PDFCombine photos and images into one PDF with page size and margin.
- PDF to JPGSave PDF pages as JPG images with your choice of resolution and quality.
- Word to PDFSave DOC and DOCX documents as PDF for reading, printing and sending.
- PowerPoint to PDFSave PPT and PPTX presentations as PDF for sharing and printing.
- Excel to PDFSave XLS and XLSX spreadsheets as PDF for reading, printing and sending.