Convert a TXT file to PDF
Drop a .txt file and get a paginated PDF, made on your device.
- Nothing is uploaded
- Works offline after first visit
- Open source
- No watermark. Up to 2 MB of text per file, about 300 pages
Converts a .txt file to a PDF with the page size and margins you choose, wrapping long lines and adding page numbers. It is free, needs no account and adds no watermark, and your file is not uploaded: it is laid out by code in this tab. Chinese, Japanese, Korean, Arabic, Hebrew, Thai and emoji cannot be drawn, and the result tells you when a file had them.
Done
Free, no ads. Support StayPut
Open the network tab. Your files never appear in it.
Add files and run the tool to see every request this tab makes.
Your files are processed on this device and never sent to a server. Reload the page to clear everything from memory.
A .txt file is the simplest document there is, which makes it awkward to print or send to someone who wants a PDF: it has no page size and no margins, and every program wraps it differently. Converting it fixes both.
Worked example. You have notes.txt saved from Notepad with the encoding set to "Unicode". Drop it, pick A4 or US Letter and press Convert to PDF. Long lines wrap at the margin, tabs become four spaces, blank lines stay, and page numbers are added at the bottom. Notepad’s "Unicode" files (UTF-16) and older Windows files in Western European encoding are read correctly, and the result says when it had to read a file as Western European.
The file is converted in your browser tab. It is not uploaded, and there is no account.
This page reads plain text only. For text you would rather paste, or a CSV or log file with aligned columns, use Text to PDF, which has a paste box and a monospace font.
How it works
- Drop a .txt file.
- Choose A4 or US Letter, margins and type size.
- Press Convert to PDF and save it.
In your browser, not on a server
Your browser reads the text, works out its encoding (UTF-8, UTF-16 or Western European), expands tabs and splits it into lines. pdfmake (MIT, built on PDFKit) breaks the lines into pages in a background worker and embeds the Roboto font and a subset of DejaVu Sans Mono for monospace text and symbols. The PDF is written in your tab.
Compared with upload-based tools: Your text goes from the box straight into a PDF made on this device, so a note, a draft or a log file is not sent to a server, and nothing is added to the page.
Verify it yourself. Give the page a short while after one visit to save itself for offline use, then turn off Wi-Fi or switch to airplane mode and run the tool again. Or open your browser's developer tools (F12, or Cmd-Option-I on a Mac), pick the Network tab, and watch it while you convert. The panel above does the same count for you.
Questions
How do I convert a TXT file to PDF?
Drop the .txt file on this page, choose A4 or US Letter and press Convert to PDF. The text is wrapped to the page, numbered and written as a PDF with the same name and a .pdf ending.
Is my file uploaded?
No. The file is read from your disk and the PDF is written in this tab, so a note, a draft or a log does not leave your device. After one visit and a short wait the page works offline.
Why is part of my text shown as a � mark?
The built-in fonts cannot draw Chinese, Japanese, Korean, Arabic, Hebrew, Thai, Indian scripts or emoji. Those characters are replaced by � and counted in the result, so you can see what was affected. For a file that is mostly in one of those scripts, open it in your browser and use Print, then Save as PDF, which uses your device’s own fonts.
What if the file shows odd characters like é in the PDF?
That happens when a UTF-8 file is read as Western European text, or the other way round. Open the options, set Text encoding to UTF-8 or to Western European, and convert again.
How big a file can I convert?
Up to 2 MB of text per file, which is about 300 pages. A PDF is laid out in your device’s memory, and larger files can make a tab run out of it, so split bigger files into parts.
More PDF tools
Text to PDF
Type or paste text, or drop a text file, and get a PDF with the page size and margins you choose, made on your own device.
PDF to EPUB
A PDF made for paper turned into an ebook that reflows on a small screen, on your own device.
Open ZIP, RAR and 7z
The files inside an archive, unpacked on your own device, without installing WinRAR or 7-Zip.
Create ZIP
Files and folders packed into one ZIP on your own device, locked with a password when they are private.