Text to PDF
Format text and print to PDF with custom styling
Document Options
Preview
Enter some text and click "Update Preview" to see how your document will look...
Turn plain text into a clean, print-ready PDF without installing anything. The tool typesets your content in a preview with your chosen font, size, margin, and page format, then hands it to your browser’s print engine to produce the file. It suits writers, students, and anyone who needs to share text in a fixed layout.
How to Use
- Paste or type your text into the editor. The character counter updates as you type.
- Choose a font size — 10, 12, 14, 16, 18, 20, or 24 points.
- Choose a font family — Serif, Sans Serif, or Monospace.
- Set the margin — 10, 15, 20, 25, or 30 mm.
- Choose a page size — A4 (210 × 297 mm) or US Letter (215.9 × 279.4 mm).
- Click Print to PDF — the preview refreshes and your browser’s print dialog opens. Pick “Save as PDF” as the destination and save.
If you only want to inspect the layout, click Update Preview instead; it refreshes the preview without opening the print dialog.
How the Browser Print Pipeline Produces Selectable Text
This tool does not rasterise your document. It builds ordinary HTML paragraphs in a preview element, styles them with the selected font family and point size, and then calls window.print(). The browser’s print engine lays that HTML out onto the chosen page size, embeds or references the fonts, and writes glyph outlines into the PDF. Because the text stays as text through every step, the saved file supports selection, copy-paste, Ctrl+F search, and screen readers. It also stays sharp at any zoom, unlike a JPEG or PNG export.
The trade-off is that the browser, not the tool, owns pagination. Line breaks, widows and orphans, and the exact number of pages are decided at print time, so the on-screen estimate can differ from the final file. If the printed result breaks a paragraph awkwardly, adjust the font size or margin and print again.
Matching the Font to the Content
| Font | Best for | Watch out for |
|---|---|---|
| Serif | Long prose, essays, letters | Slightly wider than sans at the same size |
| Sans Serif | Reports, forms, general reading | Can feel plain for long documents |
| Monospace | Code, logs, tables of aligned data | Much wider; uses more pages |
The page-size choice matters for anything destined for a printer. A4 is the standard in most of Europe, Asia, and Latin America; US Letter is standard in the United States and Canada. Content sized for one can leave large margins or clip when forced onto the other, so match the region you will print in.
Worked Example: A Three-Paragraph Letter
Suppose you paste a 1,800-character cover letter, choose Serif at 12 pt, a 20 mm margin, and A4. The estimate divides the usable width (210 − 2×20 = 170 mm) by an assumed character width of 12 pt × 0.3528 mm/pt × 0.6 ≈ 2.54 mm, giving about 66 characters per line. The usable height (297 − 40 = 257 mm) divided by a line height of about 6.35 mm gives about 40 lines per page, or roughly 2,640 characters. The estimate therefore reports one page. Increase the size to 18 pt and the character width grows to about 3.81 mm, cutting the line to roughly 44 characters and the page to about 1,100 characters — now two pages. The estimate uses text length, so it is approximate: a page full of short lines will not match the character-based math.
Common Mistakes
- Assuming the estimate is exact. It uses a fixed 20 mm margin and a generic character-width factor, so long words, lists, and blank lines all shift the real page count.
- Expecting headers, footers, or page numbers. The tool has no such fields; add a title as the first line and rely on the browser’s own print options for numbering.
- Pasting rich HTML and expecting it to render. Only the text characters survive. Angle brackets are escaped, so
<b>bold</b>prints literally. - Picking a tiny margin to fit more on a page. Inkjet and laser printers have unprintable edges; below about 10 mm, content near the border can be clipped by the printer even though the preview looks fine.
- Forgetting the destination. The dialog defaults to a real printer on many machines. Select “Save as PDF” (Chrome, Edge, Firefox) or “PDF” (Safari) before saving.
When a PDF Is the Right Format
A PDF is worth the extra step whenever the layout has to survive the trip. Plain text preserves characters but not spacing, fonts, or page boundaries; a Word document depends on the recipient having compatible software and can reflow on their machine. PDF bakes the layout in, so a form, an invoice, or a formatted essay looks the same on a phone, a laptop, and a printout. It is also the format that submission portals and application systems expect, which is why so many upload fields reject .txt and .docx. The catch is editability: once saved, the file is fixed. If you expect to revise the content, keep the original text in a document you control and regenerate the PDF after each change rather than trying to edit the PDF itself.
Related Tools
Frequently Asked Questions
Will the saved PDF contain real, selectable text?
Yes, as long as your browser's Save as PDF destination is used. The tool renders your text into an HTML preview and hands it to the browser's print engine, which embeds the actual glyphs. The result is vector text you can select, search, and copy, not a screenshot.
Why does the page-count change when I only nudge the font size?
The estimate recomputes characters per line from the font size, so a small increase shrinks the line width and pushes words onto extra lines, which cascades into another page. It is a rough estimate based on an assumed 20 mm margin, not the browser's real pagination.
Can I add a title or footer to the PDF?
The current version has no header or footer field. To add a title, type it as the first line of the text before printing; use your browser's print header/footer options if you need page numbers.
What do the five margin settings actually do?
They set the preview's inner padding in millimetres, from 10 mm to 30 mm, and they affect the on-screen preview and the printed output. The page-count estimate, however, always assumes a 20 mm margin.
Does the tool make hyperlinks clickable in the PDF?
No. URLs typed into the text are treated as plain characters, so they print as text but are not active links. The preview also escapes angle brackets, so HTML pasted as text is shown literally rather than rendered.
What happens to blank lines in my text?
Each newline becomes a paragraph in the preview. A line with content gets its own paragraph block with a small bottom margin; an empty line becomes a line break, so blank lines you use to separate sections are preserved as spacing.
Reviewed by the HandyTools Hub team · Last updated