01 / Keep
Code, logs, poems
Every line stays a line, with its spaces and indents. Long lines wrap onto the next line.
Free tool
Paste text or open one or more .txt files and get a clean PDF. Pick a regular or a typewriter-style font, the text size, line spacing and margins. Keep every line break as it is, for code, logs and poems, or join lines into paragraphs for text that was wrapped. Several files go into one PDF, each starting on a new page, or into a PDF each. Add a header and page numbers in the style you like.
Need a custom tool, app or website? Contact us →Text
Page
Several files
Press Ctrl or Cmd + S to download. Your settings are kept for next time.
Your text is turned into a PDF in your browser. It is never uploaded.
Which setting
01 / Keep
Every line stays a line, with its spaces and indents. Long lines wrap onto the next line.
02 / Join
Text copied from email or a PDF breaks every line. Joining makes flowing paragraphs, split at blank lines.
03 / Mono
The typewriter font gives every letter the same width, so tables made of spaces stay straight.
Guide
To convert text to PDF is to lay plain text, typed or from a .txt file, out on pages with a font, size, spacing and margins, and save it as a PDF anyone can open. This tool keeps the text as real text you can select and search. You choose whether every line break stays as typed or lines are joined into paragraphs, and several text files can go into one PDF, each starting on a new page.
This one setting decides whether the PDF looks right. Look at your text and ask where its line breaks came from.
.txt export or a PDF often breaks every 70 or so characters. Joining turns each block into one flowing paragraph, and a blank line starts a new paragraph.A quick test: if the preview shows short, ragged lines that end mid-sentence, switch to Join into paragraphs.
Line spacing is a multiple of the text size. At 11 pt with Normal spacing (1.45), each line takes 11 times 1.45, or about 16 points. An A4 page is 842 points tall, and Normal margins take 56 points off the top and the bottom, which leaves about 730 points for text. 730 divided by 16 is about 45 lines.
| Line spacing at 11 pt | Space per line | Lines on an A4 page, roughly |
|---|---|---|
| Tight (1.25) | 13.75 pt | 53 |
| Normal (1.45) | 15.95 pt | 45 |
| Relaxed (1.8) | 19.8 pt | 36 |
| Double (2.2) | 24.2 pt | 30 |
These counts are for lines that fit across the page. Long lines that wrap take two or more. Pick Double when someone will mark up a printed draft between the lines, and Tight with 9 or 10 pt to fit a long log onto fewer pages.
The regular font, Inter, is easy to read for prose and notes. The typewriter font gives every letter the same width, so anything lined up with spaces stays lined up: a table typed with spaces, ASCII diagrams, or columns of numbers in a log. If your text has columns that look crooked in the preview, switch the font to Typewriter.
Open or drop several text files together and each one starts on a new page of the same PDF, so you can bundle a folder of notes, meeting minutes or log files into one document. The PDF is named text-files.pdf; with one file it takes that file's name. To keep them apart, set Save as to A PDF for each file: each file becomes its own PDF, named after it, and they download together in text-pdfs.zip. If you type in the box after opening several files, they are joined into one text and the page breaks between them go away.
Some text files mark a new page with a form feed, an invisible character that old printers read as "start a new sheet". Program listings and reports saved from older systems often have them. A form feed starts a new page in the PDF too. Page numbers can read 1 / 12, Page 1 of 12 or just 1, at the centre or the right of the foot. A header is a short line at the top of every page, such as a title, a name or a date.
TextEdit can do a quick version. Open the .txt file in TextEdit and choose File > Export as PDF. It uses TextEdit's own font and margins, one file at a time. Use the tool above when you want to set the spacing, join wrapped lines or put several files in one PDF.
Want headings, bold text and lists? Write them in Markdown and use Markdown to PDF. To clean up wrapped text before you convert it, try remove line breaks. And to get text back out of a PDF, use PDF to text.
Questions
Yes. The text is written as real text with embedded fonts, not as a picture.
Yes. Choose or drop them together and they become one PDF, each file starting on a new page, in the order the browser lists them. Or set Save as to A PDF for each file and get them all in one ZIP.
A form feed character in the text starts a new page, as it does on a printer. Each file you add also starts on a new page.
The regular font covers Latin, Greek and Cyrillic, and the typewriter font Latin and Cyrillic. Letters outside these, and emoji, show as "?", and the page tells you when that happens.
Plain text has no styles. Write # before a heading and **two stars** around bold words, then use Markdown to PDF.
Text files up to 20 MB each. Very long files take longer: in our test, 15,000 lines made 556 pages in about 12 seconds.
The text had a line break at the end of every line, which is common in copied email or old text files. Set Lines to Join into paragraphs and they flow into full paragraphs.
Yes. Open the file, pick Typewriter (mono) and Keep as typed, so indents and columns stay in line. Files ending in .log, .json, .xml, .csv and other text types open too.
Yes. Set Line spacing to Double. Pair it with Wide margins if the PDF will be printed for notes.
With Keep as typed, spaces and indents are kept, and a tab counts as four spaces. With Join into paragraphs, the breaks inside a paragraph become single spaces, so indents at the start of those lines go.
Yes. The page size can be A4, US Letter, US Legal or A5, and the margins can be Narrow, Normal or Wide.
The PDF fonts do not have those letters, so they show as question marks and the page says so. Use Save with all alphabets instead: it opens your browser's print window, which draws the text with the fonts on your computer, and you choose Save as PDF there.