OnlineTextLab
Esc

TXT to PDF Converter

Plain text in, a tidy PDF out, with words you can still select and search.

0 characters

Page and text options

Page size

Orientation

Text size

Font

Courier keeps columns lined up in code and logs.

Line spacing

Page numbers

Runs on your device. Your files and text are not uploaded.

About TXT to PDF

Plain text has no pages, so it looks different on every screen and prints however the receiving program feels like. A PDF fixes the layout. That matters when you are sending meeting minutes, a server log for a support ticket, a block of notes that has to be attached to a form, or a script someone will read on paper.

You paste the text, or open a .txt, .log, .md or .csv file up to 5 MB, and press one button. The result has real text in it, so a reader can search it and copy from it. Page size, font and spacing sit in a collapsed panel and have sensible defaults, so a short note needs no decisions at all.

How it works

The PDF is written directly in your browser, line by line. Every line break you typed stays a line break, and blank lines stay as gaps. Lines too wide for the page wrap at a space, and a single word too long for the line, such as a URL, is cut at the page edge and carries on underneath. Leading spaces are kept, so indented text and code keep their shape, and tabs become four spaces. Margins are fixed at 54 points, which is three quarters of an inch.

The text uses one of three fonts every PDF reader has built in: Helvetica, Times or Courier. Nothing gets embedded, which is why files stay so small. The catch is that those fonts only cover Western European characters, as defined by the Windows-1252 character set. A few symbols get a close substitute, for example an arrow becomes ->. Anything else prints as a question mark, and a notice above the button names the affected characters before you create the file.

How to use TXT to PDF

  1. Paste into Your text, press Open a text file, or press Try an example to see the tool work first.
  2. Open Page and text options if you want to change the page size, orientation, text size, font, line spacing, page numbers, title, author, header or footer.
  3. Press Create PDF.
  4. Press the download button under Your PDF is ready. The file is named after your title or source file, or converted-text.pdf when there is neither.

The built-in example, read back from the finished PDF

Input
Minutes of the allotment committee
Tuesday 3 November

Present: Priya, Tom, Halina, Marek
Apologies: Sam

1. Water butts
   Two of the six butts leak at the tap. Tom will replace the washers
   before the first frost.
Output
Pages 1 | Words 75 | Lines 18 | PDF size 1.6 KB

Minutes of the allotment committee
Tuesday 3 November
Present: Priya, Tom, Halina, Marek
Apologies: Sam
1. Water butts
Two of the six butts leak at the tap. Tom will replace the washers
before the first frost.

The output is what a PDF reader returned from the finished file, so it proves the words are real text and not a picture. In the same test, Привет world came back as ?????? world, which is the font limit described above. Curly quotes and the euro sign survived.

When it helps

  • Attaching a server log to a support ticket that only accepts PDF
  • Turning typed meeting minutes into a file with a header and page numbers before circulating them
  • Printing a long script or set of notes with larger type and relaxed line spacing, so it can be read from a lectern
  • Keeping a copy of a plain text licence that nobody can reflow by accident

Tips for a better result

  • Pick Courier for code, logs and anything with aligned columns. Every Courier character is the same width, so columns stay lined up. In Helvetica or Times they will drift.
  • If your text came from an email or a web page with hard-wrapped lines, tick Collapse runs of blank lines into one to remove the extra gaps. Line breaks inside paragraphs stay, so fix those first if you want flowing text.
  • A title does two jobs: it prints in bold at the top of page one, and it becomes the file name.
  • For text with headings and lists that should look like headings and lists, write it as Markdown and use Markdown to PDF instead.

Good to know

  • Cyrillic, Greek, Arabic, Hebrew, Chinese, Japanese, Korean and emoji print as question marks, because no font is embedded. For those scripts, use your browser's Print command and choose Save as PDF.
  • No formatting is read from the text. Markdown symbols such as ** print exactly as typed.
  • Word files are refused. Use DOCX to PDF for those.
  • Margins cannot be changed.

Questions people ask

Can people select and search the text in the PDF?

Yes. Each line is written as text and not as an image, so search, copy and screen readers all work. You can check this yourself by running the file through PDF to Text.

Why did some of my characters turn into question marks?

The three fonts used here are the ones built into every PDF reader, and they only hold Western European characters. A notice lists the characters that are affected before you create the file, so you can switch to your browser's Print command for that document.

How large a text can it handle?

An opened file can be up to 5 MB. Pasted text has no fixed limit, but a very long paste can take a moment on your device.

What to use next

Last reviewed . Read our editorial policy.