HTML to PDF
Create a text-only PDF from HTML content; page styling and layout are not preserved.
About HTML to PDF
Developers and writers sometimes have content as HTML, such as an email template, an exported note or a snippet from a CMS, and need it as a quick PDF for review or a record. This tool strips the markup and saves the readable text as a simple PDF. It does not reproduce the look of a web page.
How it works
Your HTML is parsed in a hidden element, and the browser returns its plain text content: tags disappear and entities such as & become normal characters. Because the element is never displayed, tags like p, h1 and br do not create line breaks; only line breaks in your source code do. Text inside style and script tags is included as plain text. That text is laid out like the text-to-PDF tool: A4, 12-point Helvetica, wrapped lines. The file is html.pdf, built in your browser.
How to use HTML to PDF
- Enter the text or data in the format shown in the text box above (<h1>Hello</h1><p>Your HTML here</p>).
- Select “Run tool” and check the result before copying or downloading it.
Worked example
Entering <h1>Hello</h1><p>Your HTML here</p> on one line gives a PDF reading HelloYour HTML here, because the tags vanish without adding breaks. Writing the h1 and the p on separate lines instead gives two lines: Hello, then Your HTML here.
Tips for a better result
- Put each block element on its own line in the source. Source line breaks are the only thing that becomes a line break in the PDF.
- Remove style and script blocks first, or their CSS and JavaScript text will be printed into the PDF.
- For a styled, layout-faithful PDF, open the HTML in a browser and use its Print to PDF option instead.
Frequently asked questions
Will my CSS, colors and images appear?
No. Only text is kept. Styling, tables, links and images are dropped, and the output uses one plain font.
Why is my text all run together?
Tags such as p, div and br do not add breaks in this tool. Text from adjacent elements joins up unless your source has line breaks between them.
Can it convert a live web page by URL?
No. It only accepts pasted HTML code and never fetches anything from the web.
What to check
PDF features and encryption vary. Keep the original and check signatures, page order and readability.
Read the Privacy Policy for information about local processing, connected services and advertising.