HTML is the language web pages are written in, but it is not a convenient format to send, print, or file. A snippet of HTML on its own needs a browser to make sense of it, and it can look different depending on the screen it is viewed on. A PDF, by contrast, fixes the layout on a page. HTML to PDF turns a pasted HTML snippet into an A4 PDF of how that snippet renders, entirely in your browser. No server is involved, and no account is needed. This post walks through the basic workflow, so your first conversion comes out the way you expect.
Start with a complete snippet, not a fragment
The tool converts a snippet, so give it enough structure to render properly. A snippet that begins mid-paragraph, with an unclosed tag, may still render, but the result can surprise you: text may run together, a list may lose its bullets, or a heading may inherit styling you did not intend. Before pasting, check that every opening tag has a matching closing tag, that headings and paragraphs are properly nested, and that any inline styles are written inside the tags they belong to.
Keep the snippet focused. This tool is designed for a receipt, a short letter, a certificate, or a single-page layout, not for an entire website with navigation, sidebars, and footers. If you paste a whole page, the PDF will try to fit far more than one A4 sheet comfortably holds, and the result will feel cramped. Cut the snippet down to the content that belongs on the page, and leave the surrounding website furniture out.
Paste, render, and read the result
Paste your HTML into the tool and generate the PDF. Then, before you send or file it, open the PDF and read it as a reader would, not as the person who wrote the code. Check the top of the page first: does the heading sit where you expected, with sensible space around it? Move down through the body: are paragraphs separated cleanly, are lists indented evenly, and does any text run to the edge of the page or get cut off?
Pay attention to width. A snippet designed for a wide desktop screen may be too wide for A4, especially if it contains a table with many columns or a long unbroken line such as a web address. If content is squeezed or clipped, simplify the layout: shorten the table, stack columns, or break long lines before converting again. One quick second pass usually fixes more than a long debugging session.
Worked example: a fictional order confirmation
Consider a fictional example. Maya Patel, an invented shop owner, wants a one-page order confirmation for a customer, using only made-up details. The snippet contains a heading, "Order Confirmation", the fictional order number ORD-1001, a short line naming the customer as Alex Morgan at alex@example.com, and a small table with two invented items: a linen apron at 24 and a sewing kit at 18, with a total of 42. Maya pastes this snippet into HTML to PDF and downloads the A4 result.
On reading the PDF, Maya notices the table headings look cramped, because the table was written without any cell padding. She adds a little padding to the table cells in the HTML, converts again, and the headings breathe properly. She also notices the total row blends into the item rows, so she makes it bold in the markup and converts a third time. Each round takes a minute, and the final PDF is a clean, readable confirmation that can be emailed or printed without worrying about how a browser will display it. The lesson is to treat the first conversion as a draft and the second or third as the finished page.
Styling that helps, and styling that hurts
Simple styling converts most reliably. Headings with clear sizes, paragraphs with comfortable line spacing, and tables with borders and padding are all safe choices. Colour works too, but use it sparingly on a document meant for printing: light text on a dark background that looks striking on screen can print poorly and waste ink. Dark text on a light background remains the most reliable choice for anything that may be printed.
Avoid relying on features that belong to a live web page rather than a printed page. Interactive elements, hover effects, and animations have no meaning on a PDF page, and complex multi-column layouts designed for wide screens often collapse awkwardly on A4. Design for the page from the start: one column of content, clear headings, and generous margins, and the conversion will reward you with a result that matches your intention.
For advice on making that page easy to read, see how to improve readability.
Print one test copy when it matters
If the PDF will be printed, print one test copy before you print a batch or send it to someone else for printing. Screens hide problems that paper reveals: margins that look generous on a monitor can feel tight on paper, light grey text that reads fine on a backlit display can fade on a printed page, and a table that fits the screen width may sit awkwardly within printed margins. A single test page costs little and answers questions that no amount of on-screen previewing can settle. If the test copy reveals a problem, fix the HTML, convert again, and test once more. That loop is quick, and it is far cheaper than discovering a layout fault after fifty copies have been printed or after a customer has already received the document.
Honest limitations
HTML to PDF has limits worth knowing before you rely on it. CSS and print support are not unlimited: some advanced layout features, web fonts, and interactive behaviour may not survive conversion, and the output is a rasterised rendering of the page rather than selectable, reflowable text in every case. That means you should always inspect the PDF itself, not just the HTML in a browser, before sending it. Scripts are stripped from the snippet before conversion, for safety, so any behaviour that depends on JavaScript will not appear in the PDF. If your document needs a script to calculate a total or show a date, calculate those values and write them into the HTML before converting. Finally, page size is A4, so a long document will flow across several A4 pages rather than shrinking to fit one; design long content to paginate gracefully, with headings that do not strand at the bottom of a page.
FAQs
How do I turn an HTML snippet into a PDF?
Paste the snippet into HTML to PDF, generate the result, and download the A4 PDF. Check the PDF itself before sending it, since the rendered page is what the recipient will see.
Will my CSS styling survive conversion?
Basic styling, such as headings, colours, padding, borders, and table layout, usually survives well. Advanced layout features and interactive behaviour may not, so keep the design simple and inspect the output after each change.
Why are scripts removed when converting HTML to PDF?
Scripts are stripped for safety, so code in a pasted snippet cannot run during conversion. If you need a calculated value in the PDF, work it out beforehand and write the finished number into the HTML.
What page size will my HTML PDF use?
A4. Content longer than one page flows onto further A4 pages, so design with page breaks in mind rather than expecting everything to shrink onto a single sheet.
If you need to combine the finished PDF with other documents, Merge PDF joins files in your chosen order, and JPG to PDF turns images into a PDF when a document starts life as photographs.
human review pending client designation