It is a structural converter rather than a screenshot tool, and the difference matters. No stylesheet is applied, no script runs and no images are fetched. What you get is the document that the markup describes, set in a clean serif free typeface at the size and margin you choose, with real selectable text rather than a picture of a web page.
Everything is done by your own browser. The markup is parsed with the built in HTML parser, the PDF is assembled in memory and handed straight back as a download. Nothing is sent to a server, so internal reports and unpublished drafts stay on your machine.
When a structural conversion is what you want
Print to PDF from a browser gives you a picture of the rendered page, complete with navigation bars, cookie banners and whatever the stylesheet happened to do at that viewport width. That is the right output when the design is the point. It is the wrong output when the words are the point. The usual reason to save web page markup as pdf is archival: a receipt, an invoice or a confirmation page that needs to survive the site it came from.
This tool produces the second kind of file. It is useful whenever the markup is the source of truth and the PDF is a delivery format rather than a design artefact.
- Turn generated report markup into a document you can email or archive.
- Produce a plain, readable PDF from an article without the site furniture around it.
- Convert an HTML export from a wiki, a CMS or a note taking app into a paged document.
- Build a printable copy of documentation where the code samples must stay legible.
- Make an accessible text based PDF from markup that a print stylesheet mangles.
What this converter renders and what it ignores
Every element that carries document structure is honoured. The six heading levels are scaled relative to your base font size and set in bold, paragraphs wrap to the measure, lists are marked and indented with nesting preserved, tables are flattened row by row with header cells emphasised, preformatted blocks are set in a monospaced face with their line breaks intact, and a horizontal rule draws a real line.
Presentation is deliberately dropped. Stylesheets, inline style attributes, class based layouts, floats, grids, absolute positioning, web fonts, colours, background images and inline pictures are all ignored, and script tags are never executed. Reproducing those faithfully needs a full browser engine painting onto a PDF surface, which is not something a page can do on its own.
One option bridges the gap for print. Link addresses can be printed in brackets after the link text, so a reader holding a paper copy can still see where a hyperlink pointed.
How the html to pdf converter handles page breaks
Layout is a single pass. Each block is measured against the width of the text column, wrapped into lines using the real metrics of the embedded font, and drawn from the top margin downwards. When the next line would cross the bottom margin a new page starts and the line is drawn there instead.
That means breaks happen between lines rather than inside them, and a long table or list continues cleanly onto the following page. It also means the tool does not currently avoid a heading being left alone at the foot of a page, so if you need tighter control over pagination, raise the margin or drop the base font size by a point and convert again.
Page size is your choice of A4, US Letter or US Legal, and the margin slider moves all four edges together between 24 and 96 points, which is roughly 8 to 34 millimetres.
How to convert html to pdf without uploading anything
The markup is handed to the browser DOMParser, the same parser that builds a page when you visit a site. Because the result is a detached document, nothing in it can run: scripts are inert, no network request is issued for an image or a stylesheet, and the tree exists only so it can be walked.
The walk flattens that tree into an ordered list of typographic blocks, and a PDF writer draws those blocks with the standard Helvetica and Courier fonts. Both steps are plain JavaScript inside your tab, which is why the conversion is instant and why the file never leaves the device.
Text that falls outside the WinAnsi character set the standard PDF fonts use is mapped down where an obvious equivalent exists, so curly quotes and ellipses survive as their plain equivalents. Scripts such as Greek, Cyrillic or Chinese cannot be drawn with those fonts and appear as question marks.
Getting a good result from an html file to pdf conversion
Feed the converter the cleanest markup you have. If you saved a page from a browser, the file usually contains a wrapper of navigation, sidebars and footers, and all of that text will appear in the PDF because the tool has no way to know it is decoration. Trimming to the article element before converting gives a far better document.
Fragments are fine. You do not need a full document with a doctype and a head, and a handful of headings and paragraphs converts exactly as well as a complete page. Anything you paste is parsed as the body of a document.
For long technical material, drop the base font size to 9 or 10 points before you convert. Preformatted code is hard wrapped at the column width rather than word wrapped, so a smaller size keeps more of each line intact.
| Markup | Result in the PDF |
|---|---|
| h1 to h6 | Bold headings scaled from the base font size |
| p, blockquote, figcaption | Wrapped body paragraphs |
| ul, ol and nested lists | Marked and indented list items |
| table | One line per row, header cells in bold |
| pre and code blocks | Monospaced lines with breaks preserved |
| img, video, script, style | Ignored entirely |
How to convert HTML to PDF
- 1
Add your markup
Paste HTML into the editor, or drop a .html or .htm file onto the drop area to load its contents.
- 2
Pick the page size
Choose A4, US Letter or US Legal depending on where the document will be printed or filed.
- 3
Set the type size and margin
The base font size scales every heading with it. Widen the margin for a document that will be bound or annotated.
- 4
Decide about link addresses
Leave the link option on to print each URL after its anchor text, which matters for a copy that will be read on paper.
- 5
Convert and download
Press convert, check the page count in the panel, then download the finished PDF to your device.
Related tools worth bookmarking
Sources and further reading
- WHATWG: the HTML Living StandardThe specification that defines the elements this converter maps onto document structure.html.spec.whatwg.org
- MDN: DOMParserThe browser API used to parse your markup into an inert document tree that cannot run scripts.developer.mozilla.org
- ISO 32000-2: Portable Document FormatThe PDF specification, including the standard font set the text in the output is drawn with.iso.org
Frequently asked questions
Common questions about the html to pdf converter.
No. Stylesheets, style attributes and class based layouts are ignored entirely, and the document is set with the tool's own typography instead. Reproducing CSS layout in a PDF requires a full browser rendering engine, which cannot run inside a page like this one.
No. Image elements are skipped, because fetching them would mean issuing network requests for remote files and would break the promise that nothing leaves your device. Convert pictures separately and assemble the pages afterwards if you need them.
Yes. Every block is drawn as real text with an embedded standard font, so the result can be searched, selected, copied and read aloud by a screen reader. It is not a raster image of a page at any point.
You can, but the output will include the navigation, sidebar and footer text along with the article, since none of that is marked as decoration in a way the tool can detect. Trim the markup to the main content first for a much cleaner document.
The standard PDF fonts cover the WinAnsi character set, which is Latin script plus common punctuation. Curly quotes, dashes and ellipses are mapped to plain equivalents, but Greek, Cyrillic, Arabic and Chinese characters have no substitute and are replaced.
None is imposed by the tool. Parsing and layout are bounded only by the memory your browser tab can use, and a document of several thousand blocks converts in well under a second on current hardware.