TXT to PDF
Turn a .txt file, or text you type or paste, into a PDF you can send or print. The words stay real text, so they can still be searched and copied, and nothing is uploaded.
Drop a text file here
A .txt file, or a .csv, .log or .md. It stays on this device. Nothing is uploaded.
Line breaks are kept as they are, and long lines wrap to fit the page.
How to convert a text file to PDF
- Press “Choose a text file”, or drop a .txt file onto the box above. You can also type or paste text into the box below it.
- Pick a font, a text size, a page size and margins. Monospace keeps columns and tables lined up.
- Press “Convert & download”. If the text has characters the fonts cannot draw, the page names them and offers to go ahead with a ? in their place.
What TXT to PDF does
Turning plain text into a PDF: notes, a log, a README, a list somebody asked for as a PDF, or text copied out of something that only gives you text. Drop a file or paste the text, pick a font and a page size, and download.
What it does
- Turns a .txt file, or text typed or pasted into the page, into a PDF
- Keeps the words as real, selectable text in a standard PDF font
- Keeps line breaks and indentation, wraps long lines, and starts a new page at a form feed
- Offers monospace, sans-serif and serif fonts, five text sizes, A4 or US Letter, and three margins
- Reads UTF-8, UTF-16 and older Windows text files
What it does not do
- Upload anything; the PDF is built in this browser tab
- Handle scripts beyond English and Western European languages yet; it names the characters it cannot draw instead of leaving gaps
- Turn Markdown, HTML or Word formatting into headings and bold; the text goes in as written
- Number the pages; Add page numbers can do that afterwards
Last updated
Need to send this to someone?
Our sister site QRSansar hosts a document and gives you a short link and a QR code for it. That is handy for WhatsApp, a slide, a poster or a printed handout, and it avoids attachment size limits entirely. You can swap the file later and the link and QR code keep working.
Worth being clear about the difference: that is a hosting service, so your file is uploaded to it. Everything on PDFsansar stays on your device; sharing is the one job that cannot.
Share a document on QRSansar →Other tools
All free, and all run in this tab without uploading anything.
TXT to PDF: common questions
Can I copy and search the text in the PDF?
Yes. The text goes into the PDF as text, in a standard PDF font, not as a picture of it. It can be selected, searched, copied and read aloud by a screen reader, and the file stays small.
Which languages work?
English and the Western European languages, such as French, Spanish, German, Portuguese, Italian, Dutch and the Nordic languages, plus the euro sign and curly quotes and dashes. The PDF fonts used here have no letters for other scripts, such as Arabic, Chinese, Cyrillic, Greek or Devanagari, so text in those does not work yet. If a file has just a few such characters, an emoji for example, the tool names them and can put a ? in their place.
Will my layout survive?
Line breaks, blank lines and indentation are kept exactly. In the monospace font, which is the default, columns and tables lined up with spaces stay lined up, as they looked in a text editor. Lines too long for the page wrap onto the next line, and a form-feed character, which some programs use to mark a new page, starts a new page.
Why do some characters look wrong?
Usually because the file was saved in an older encoding. This tool reads UTF-8 and UTF-16, and falls back to the Windows encoding older Western European files use, so accented letters normally come out right. If a file was saved in some other encoding, open it in a text editor, save it as UTF-8 and try again.
Is my text uploaded?
No. The file is read and the PDF is built in this browser tab. Nothing you drop or paste is sent anywhere.
Does it keep Markdown or Word formatting?
No. It takes the characters as they are, so a .md file comes out with its # and * showing. A Word document is not a text file at all. For headings and bold, use the word processor's own Save as PDF.