Skip to content
Toolew.com

Text to PDF

Turn plain text or a .txt file into a clean PDF with word wrap, paper size, margins, fonts, header, page and line numbers.

Runs in your browser. Your data is not uploaded. This tool downloads a larger processing engine the first time you use it.
Loading tool…

Tool guide

What this tool does

Text to PDF lays out typed, pasted or loaded text on PDF pages. Choose A4, Letter or another paper size, set margins, font and line spacing, add a header title, page numbers or line numbers for code, and preview the first page as you type.

Plain text is the most portable format there is, but it does not print or share well. Opened on another device, a .txt file may wrap differently, use a strange font, or show no page breaks at all. Log files, meeting notes, transcripts, code listings and exported chat histories all benefit from being turned into a fixed, paginated document.

This tool wraps your text to the page width using the exact character widths of the chosen font and builds the PDF with pdf-lib. Helvetica, Times and Courier are the standard PDF fonts, so the file displays identically in every viewer without embedding font files, which keeps it small. Long words such as URLs are broken safely, tabs become spaces, and a form-feed character forces a new page. The conversion runs in your browser.

How to use Text to PDF

  1. Type or paste text into the editor, load a .txt or code file, or press Sample to try it.
  2. Under Page and text choose the Paper size, orientation and Margins.
  3. Pick a Font and Font size; Courier keeps columns aligned for code and tables.
  4. Adjust Line spacing and, if you like, add a Header title that repeats on every page.
  5. Switch Page numbers and Line numbers on or off and set the output file name.
  6. Check the preview of page 1, press Create PDF, and download the file.

Tips for better results

  • A 10 or 11 pt font with 1.4 line spacing reads comfortably on A4 and Letter.
  • Use Courier with Line numbers for source code reviews or legal transcripts where lines must be referenced.
  • Insert a form-feed character (Ctrl+L in many editors) where you want a page break, for example between chapters.
  • A narrower margin of about 12 mm fits more text on each page for drafts you only need to read on screen.

Common use cases

  • Printing meeting notes or a to-do list with a title and page numbers.
  • Archiving server log excerpts or chat exports as fixed documents.
  • Sharing a code listing with line numbers for review.
  • Submitting a plain-text essay or statement where a PDF upload is required.

Common mistakes to avoid

  • Using non-Latin scripts such as Greek, Arabic or Chinese. The standard PDF fonts only cover Western European characters, and other characters are replaced with a question mark.
  • Expecting Markdown or HTML formatting to be applied. The text is laid out exactly as typed, including asterisks and tags.
  • Choosing Helvetica for column-aligned data; only a monospaced font like Courier keeps columns lined up.

Frequently asked questions

Which characters are supported?

The standard PDF fonts use the WinAnsi character set: English and Western European letters, digits, common punctuation, and symbols such as € and £. The tool warns you about any characters it had to replace.

How large can the text be?

Several megabytes of text work fine. The live preview only lays out the first page, and the full document is built when you press Create PDF.

Is the text in the PDF searchable?

Yes. It is written as real text, so it can be selected, copied and searched in any PDF viewer.

Is my text uploaded?

No. The PDF is generated in your browser and the text never leaves your device.

Feedback & suggestions

Help us improve Text to PDF. We read every message.

Rating (optional)
Necessary
Required for security, language and theme preferences. Always on.