The code, not the page
Most HTML to PDF tools render the page: you get the headings, pictures and layout a visitor would see. Sometimes you need the opposite. A teacher marking a web design assignment, a developer reviewing a pull request on paper, or a team archiving the exact markup behind a landing page all want to read the source itself, tag by tag.
This page does exactly that. Tags, attributes and values are coloured differently, and CSS inside style tags and JavaScript inside script tags are highlighted in their own languages. Nothing in the file is run or loaded, so the PDF shows the code as you wrote it.
If you want the finished page as a PDF instead, use HTML to PDF, which renders the HTML with its styles and images.
Readable on paper and on screen
Line numbers make it easy to point at a problem, such as a missing closing tag on line 48. Long lines, common in HTML with many classes, can wrap with a small marker or shrink to fit. The text is set in an embedded monospace font, and it stays real text: you can search the PDF or copy a snippet back into your editor with its indentation.
For a whole site, press Upload a folder. Each HTML, CSS and JavaScript file is added with its path, and you get one PDF with a clickable contents page and a bookmark for each file. More options are on the main Code to PDF page.
Private by design
When the PDF is ready, you can add a password with Protect PDF or combine it with other documents using Merge PDF.
Your files never leave your device. HTML Source Code to PDF runs entirely in your browser.