Skip to content
YardMaths PDF

Convert text to a PDF

Paste text or choose a .txt file. Lines are wrapped, pages are numbered if you wish.

Drop text files here

or drag them here, or paste them.

Privacy: your files are opened and processed by your browser, on this device. They are never uploaded to YardMaths or anyone else, and they are gone when you close the tab.

How to convert text to PDF

  1. Choose a text file (.txt, .log, .md or .csv), or open “Or type or paste your text here”, paste your text and press Use this text.
  2. The card shows how many lines and words it found. Add more files if you want one PDF for each.
  3. Pick the font (Helvetica, Times or Courier), the size, the line spacing, the page size, the orientation and the margins. Tick Number the pages if you want a page number at the bottom.
  4. Press Create PDF. Long lines are wrapped to the page width and the text flows onto as many pages as it needs.
  5. Download the PDF, or a ZIP if you added several files.

Why this tool runs in your browser

Text files hold the kind of content people paste without thinking: meeting notes, a draft letter, a log with passwords in it. Here the text is laid out and written into the PDF by your own browser. It is never sent to a server, and closing the tab removes it from memory.

The PDF uses the three standard fonts that every PDF reader already has, so there is no font to download and the file stays small. The trade-off is explained below: the fonts cover Western European languages, not every script.

How the text is laid out

  • Line breaks you typed are kept. Blank lines stay blank, and a form-feed character in the text starts a new page.
  • Lines longer than the page are wrapped at spaces. A single word longer than a whole line is split where it no longer fits.
  • Tabs are replaced by spaces in steps of four columns. Leading spaces are kept, so indented text stays indented.
  • Pick Courier for code, tables made of spaces and anything that must line up in columns; Helvetica and Times use proportional letters.
  • Markdown is printed as plain text. Headings, bold and links are not turned into formatting.

Limits to know before you start

  • Only characters of the standard PDF fonts can be shown: English, Spanish, French, German and other Western European text. Other scripts (Cyrillic, Greek, Arabic, Chinese, Japanese, Korean) and emoji are replaced with “?”, and you are told how many.
  • The result is plain text on plain pages. There are no headings, bold text, images or tables.
  • Files that contain binary data are refused, because they are not text.
  • Very long texts make long PDFs (a few megabytes of text can mean thousands of pages) and need time and memory on a phone.
  • Text files are read as UTF-8 or UTF-16; older files saved in a Windows encoding are read as Windows-1252.

Text to PDF FAQ

How do I turn text I copied into a PDF?

Open the box that says “Or type or paste your text here”, paste the text, press Use this text, then press Create PDF. The pasted text is handled like a file called pasted-text.txt, and the PDF is named after it.

Why do some of my characters show as question marks?

The PDF uses the three fonts every reader has built in. They cover Western European letters, quotes and symbols, but not other alphabets or emoji. Those characters become “?”, and the page tells you how many were replaced.

Which font should I choose for a text file?

Choose Courier for code, logs and anything that must line up in columns, because every letter has the same width. Helvetica is a clean sans-serif for notes and letters. Times is a serif font that looks like a printed page.

Can the PDF have page numbers?

Yes. Tick Number the pages and each page gets its number, centered at the bottom, inside the margin. The numbers are plain 1, 2, 3, without the total.

Does this keep the formatting of my Word document?

No. It reads plain text only. Copy the text out of a Word file and paste it in if you only need the words; any bold, fonts, pictures or tables from the original are not carried over.

Last updated . Free to use, no sign-up.