Text to PDF – Create a PDF from Plain Text

Paste or type plain text and get a clean A4 PDF with the font size and margins you choose. Lines wrap automatically and pages are added as needed.

Processing Complete!

Your text is turned into a PDF in this browser tab with pdf-lib and is not uploaded.

How to turn text into a PDF

  1. Type or paste your text into the box. Blank lines are kept, so paragraphs stay separated.
  2. Choose a font size: 10, 12 (default), 14, 16, 18 or 24 points.
  3. Set the margin in points. It applies to all four sides; values from 10 to 100 are accepted and the default is 50. For reference, 72 points is one inch (25.4 mm), so 50 points is about 17.6 mm.
  4. Press Generate PDF.
  5. Download document.pdf.

How the PDF is built

Everything happens in your browser with the open-source pdf-lib library. The tool creates an A4 portrait page (210 × 297 mm, or 595.28 × 841.89 points) and uses Helvetica, one of the standard fonts that every PDF reader provides. Your text is split into paragraphs at each line break and into words at spaces. Words are added to a line as long as the measured width fits between the margins; then a new line starts. Lines are spaced at 1.5 times the font size, and when the next line would run into the bottom margin, a new page begins. The text is drawn in black, left-aligned, and remains real text: you can select, search and copy it in the finished PDF.

With the default 50-point margin, a page holds this many lines:

Font sizeLine spacingLines per A4 page
10 pt15 pt49
12 pt18 pt41
14 pt21 pt35
16 pt24 pt31
18 pt27 pt27
24 pt36 pt20

Which characters work

The built-in Helvetica font uses the Windows-1252 character set. That covers English and most Western European languages (é, ü, ß, ñ, ø), curly quotes, dashes, the bullet • and the € sign. It does not cover Chinese, Japanese, Korean, Arabic, Hebrew, Cyrillic or Greek, Central European letters such as ł or č, or emoji. If your text contains one of these, the tool shows an error naming the character; remove or replace it, or use one of the alternatives below.

Tips

Good for

Limitations and alternatives

Frequently asked questions

Which page size does the PDF use?

A4 portrait, 210 × 297 mm. It prints on US Letter paper when you choose "Fit to page" in the print dialog.

Can I use Chinese, Russian or emoji?

No. The built-in Helvetica font only covers the Windows-1252 character set used for English and Western European languages. For other scripts, export from a word processor or print a text file to PDF from your browser.

Why did my indentation disappear?

Text is re-wrapped word by word, so leading spaces, tabs and repeated spaces are reduced to single spaces. Blank lines between paragraphs are kept.

Is the text in the PDF selectable and searchable?

Yes. The text is written as real text in Helvetica, so you can select, search and copy it.

How many lines fit on one page?

With the default 50-point margin: 41 lines at 12 pt, 49 at 10 pt and 20 at 24 pt.

Can I change the font or the page size?

No. The tool always uses Helvetica on A4 portrait pages. Font size and margins are the adjustable settings.

Is my text sent anywhere?

No. The PDF is generated in your browser, and your text is neither uploaded nor stored.

Related tools