HTML to PDF Converter

Turn an HTML file or a saved web page into a clean PDF document. It keeps the structure that matters, headings, lists, quotes and preformatted blocks, and throws away the scripts, styles and markup that should never appear as text. Nothing is uploaded.

  • Nothing uploaded
  • Works with no signal
  • No sign up
  • Searchable output
Drop an HTML file here or click to choose one. Files ending .html or .htm, including pages saved from a browser. Nothing is changed until you press the button.

or paste the markup in

Nothing loaded yet.

What was read

Showing how the page falls onto paper.

Add some HTML to see the pages.
heading paragraph list item preformatted quote

Text goes in as real text, so the finished PDF stays searchable. Links become their label text and images become their alt text, because nothing is fetched from the network.

Your page never leaves this device.The file is read by your browser, the PDF is built here in the page, and the download comes from your own machine. Nothing is sent to a server, and no address inside your HTML is ever fetched, so a saved page cannot phone home while it is being converted.

1Drop the HTML inIt never leaves your machine.
2Set the pageEverything updates as you change it.
3Build and downloadAssembled here and saved from your own browser.

The document, not the design

Scripts, styles and comments are removed before anything is read, so their contents never appear as sentences. What is left is the article the page was carrying.

How to use this tool

Drop an HTML file on the box at the top or paste the markup straight in. The structure it found appears immediately, along with the page count.

Set the body size and the page. Headings scale from the body size, exactly as they do in the source document.

The preview shows each line as a bar coloured by the kind of block it belongs to, so you can see at a glance whether the headings and lists came through the way you expected.

This converts the content, not the appearance

Worth being clear about up front, because it is the difference between this and a screenshot.

A web page is two things at once. There is a document underneath: headings, paragraphs, lists, quotations, tables. And there is everything the CSS does to it: columns, colours, spacing, typefaces, imagery. Only the first of those is content. The second is presentation, and it is specific to a screen of a particular size.

This tool takes the document and lays it out cleanly on paper. Headings stay headings, lists stay lists, preformatted blocks keep their spacing. The CSS is discarded, so the result will not look like the site. It will look like the article the site was carrying, which is usually what you actually wanted when you went to print a page.

If you genuinely need a picture of the page as rendered, your browser's own print to PDF is the right tool, because it has the CSS and the layout engine. This is for when you want the words.

What gets thrown away, and why that matters

Scripts, stylesheets, comments and inline SVG are stripped before anything else happens. That is not tidiness, it is correctness: their contents are code, and code appearing as sentences in the middle of a document is a real failure that naive tag stripping produces constantly.

Removing only tags leaves CSS and JavaScript as body text, while removing those elements first leaves only the document
Remove only the tags and script and style contents become sentences in your document.

Unterminated tags are handled too. A page with an opening script tag and no closing one would otherwise leak its entire remaining body into the output, so that case is cut off explicitly.

Nothing is fetched. Images become their alt text and links become their label text, because retrieving a picture or following an address would mean a network request. On a page saved from somewhere else that also means it cannot quietly announce that you opened it.

Character entities are decoded properly, both the named forms and the numeric ones, so a page written with the escaped form of a less than sign reads as a less than sign rather than as markup.

A worked check you can repeat

Whitespace is the case that catches out most simple converters. In HTML, a newline inside a paragraph is just a space: the markup is allowed to be wrapped however the author liked, and it means nothing.

So a paragraph written across three lines in the source is one paragraph, not three. Treat those newlines as breaks and a normal document shatters into fragments. The exception is a preformatted block, where newlines and indentation are the entire point, so those are lifted out and protected before the rest of the whitespace is collapsed.

The parser was checked against an independent implementation before publishing: thirty seven hand written cases covering named, decimal and hexadecimal entities, unknown entities left alone, a bare ampersand left alone, script and style and comment removal, unterminated tags, headings, lists, quotes, rules, line breaks, nested inline tags, tables and preformatted indentation. Then twenty thousand generated cases confirming that no script, style, comment or SVG content ever reaches the output, that no raw tag survives into the text, and that no numeric entity is left undecoded.

The page layout underneath is the same one used by the Markdown converter, which measures heights in points rather than counting lines, because a heading and a body line are not the same size.

Mistakes that catch people out

Expecting the site design. The CSS is discarded. If you need the page as it looks, use your browser's print to PDF instead.

Expecting images. They become alt text, because fetching them would mean a network request.

Feeding it a page saved with a wrapper. Pages saved from a browser often carry navigation, cookie notices and footers. All of that is content too, and it will come through. Trim it first if you only want the article.

Unclosed tags. A missing closing tag changes the structure the parser can see. If the output breaks into odd paragraphs, that is usually why.

Assuming a table will look like a table. Cells are separated and rows become lines, which is readable, but a real table with ruled columns needs the CSV converter instead.

Common questions

Is my HTML uploaded anywhere?

No. The file is read by your browser, the PDF is built here on the page, and the download comes from your machine. No address inside your HTML is ever fetched either, so a saved page cannot reach the network while it is being converted.

Will it look like the web page?

No, and that is deliberate. This converts the content of a page rather than a picture of it. Layout, colours and images live in the CSS, which is discarded, so what you get is the document underneath.

What happens to scripts and styles?

They are removed before anything else, along with comments and inline SVG. Their content is code rather than reading matter, and it must never end up in the document as text.

Do images come through?

No. An image becomes its alt text. Fetching the picture would mean a network request, which would break the promise that nothing leaves your machine.

Does preformatted text keep its spacing?

Yes. Content inside a pre element is set in a fixed width face with its line breaks and indentation intact, which is the one place in HTML where whitespace carries meaning.

Why did my page break into odd paragraphs?

Almost always an unclosed tag. A missing closing tag makes everything after it part of the same element, so the structure the parser can see is genuinely different from the one you intended.

Related PDF tools and reference

Reference: The HTML parsing specification, which defines the entity and whitespace rules followed here.