Text to PDF Converter

Paste text or open a .txt file, choose the font, page size and margins, and download a clean PDF. Nothing is uploaded.

Your text and page settings

.pdf

How to convert text to PDF

  1. Type or paste into Text to convert, or press Open a text file to load a .txt file. Press Clear to remove the sample first.
  2. Choose the Font, Font size, Line spacing, Page size, Orientation and Margins. Tick Add page numbers if you want a footer.
  3. Set the File name and click Download PDF. The result line reports the page count and file size.

How the page is laid out

The text area is the page minus the margin on each side. Each line is measured with the real width of every letter in the chosen font, and a line is wrapped at the last space that still fits. The height of a line is the font size times the line spacing. When the next line would run into the bottom margin, a new page starts. The PDF is written with the open-source pdf-lib library, using the standard PDF fonts Helvetica, Times Roman and Courier, so the file is tiny and the text stays selectable and searchable.

Those standard fonts only hold Western European letters. When your text needs more, the tool switches the whole document to the matching DejaVu font, embedding only the letters you used.

Worked example

Leave the sample memo and the defaults: US Letter (612 x 792 pt), 1.0 in margins, Helvetica 12 pt, Normal (1.4) spacing. The text area is 468 x 648 pt and each line is 16.8 pt high, so a page holds 38 lines. The memo is 14 lines, so Download PDF reports "PDF ready: 1 page, US Letter, Helvetica 12 pt, 1.3 KB."

Limits and edge cases

Frequently asked questions

Can I convert text with accents, symbols or emoji to PDF?

Yes for most of them. The built-in fonts cover English and Western European letters. If your text contains other characters, such as Polish or Turkish letters, Greek, Cyrillic, arrows or many symbols, the tool downloads a DejaVu font (about 0.3 to 0.8 MB) and uses it for the whole document. Chinese, Japanese, Korean and right-to-left scripts are not supported, and any character that no font can show is replaced with a question mark and listed in the result.

How do I keep the line breaks and indentation of my text?

Every line break you type is kept, blank lines stay blank, and spaces at the start of a line are kept as indentation. Tabs are expanded to the next multiple of four spaces. Lines that are longer than the page is wide are wrapped at spaces, and a word that is wider than the page is split.

Can I make parts of the text bold or change the heading size?

No. This tool sets every character in one font and size, which is what plain text means. For headings, bold, italics, lists and tables, write Markdown and use the Markdown to PDF converter, or use the HTML to PDF converter.

How many pages will my text take?

With the defaults (US Letter, 1.0 inch margins, Helvetica 12 pt, normal spacing) a page holds 38 lines of roughly 75 to 80 characters each, which is about 400 words of ordinary paragraphs. Larger fonts, wider margins and double spacing all reduce that, and the result line tells you the exact page count after you download.

Need formatting? Try Markdown to PDF or HTML to PDF. To check how long your text is first, use the Word Counter, and to join the result with other files, the PDF Merger.

Sources: pdf-lib documentation; PDF standard fonts (Wikipedia); DejaVu Fonts.