Convert TXT to PDF
FileReshape's TXT to PDF converter lays out a plain text file on A4 or US Letter pages in your browser, and you save it as a PDF with selectable text through the browser's print dialog. The file is not uploaded. Long lines wrap instead of being cut off, the encoding is detected for you, and there is no direct download button: the PDF comes from the print dialog.
Did a file not convert correctly? E-mail [email protected], ideally with a small sample file, and it will be fixed.
Key facts
- Input: Plain text (.txt). Output: PDF (.pdf).
- Your files are not uploaded: the work is done in your browser, on your own device.
- File size: no fixed limit; very large files are limited by your device's memory.
- Needs a current browser (Chrome, Edge, Firefox or Safari) on a computer, tablet or phone; nothing to install.
- Free to use, with no sign-up.
Why turn a text file into a PDF
A .txt file opens on every computer, but it does not print well from a browser or a phone, and it is not what a form, a teacher or a client portal asks for when they want a PDF. This tool reads the text file in your browser, lays it out on real pages and hands it to the print function that every browser has. There you choose "Save as PDF", and the browser writes a PDF with sharp, searchable text instead of a picture of each page. Pick a monospaced font to keep tables, code, logs and ASCII art lined up, or a normal font for letters and notes. Line numbers help when you send a log file or a script for review. Text in UTF-8, UTF-16 or older Windows encodings is recognised, so letters such as å, ü and é come out right, and every alphabet your computer has a font for prints, including Chinese, Arabic and Cyrillic.
How to convert TXT to PDF
- Drop your .txt file in the box, or click to choose it. A preview of the pages appears.
- Pick the page size, margins, text size and font. Turn on line numbers if you need them.
- Click Create PDF. In your browser's print dialog, choose "Save as PDF" as the printer or destination and save the file.
What to know about text files and PDF
The PDF is made by your browser's print dialog
There is no direct download. The browser's print engine wraps lines, picks fonts for every alphabet and writes real text into the PDF, which is hard to do well inside a web page. In the print dialog, set the destination to "Save as PDF" (Firefox calls it "Save to PDF"; in Safari on a Mac use the PDF button, on an iPhone use Share and then Save to Files). Turn off "Headers and footers" if you do not want the date and a web address on every page.
Long lines are wrapped, not cut off
A line that is wider than the page continues on the next printed line, so nothing is lost at the right edge. With line numbers turned on, a wrapped line keeps one number, which makes it easy to see where the original line ended. If wide tables or logs wrap too much, choose the small text size or small margins.
Page breaks
A text file has no pages of its own, so the browser starts a new page whenever one is full. A form feed character, which some programs and old reports use to mark a new page, starts a new page in the PDF too.
Wrong letters
Text that is valid UTF-8 is read as UTF-8; anything else is read as Windows-1252, the usual encoding of older Western European Windows files. The summary shows which one was used. A file in another legacy encoding, such as a Cyrillic or Greek code page, can show wrong letters; open it in a text editor, save it as UTF-8 and convert it again.
About the formats
Plain text
A plain text file (.txt) holds only characters and line breaks: no fonts, colours, images or layout. That makes it the most portable document format there is, readable by every editor, search tool and programming language.
- The encoding decides how letters beyond A-Z are stored; UTF-8 covers every alphabet.
- Windows ends lines with CR LF, Mac and Linux with LF; current editors read both.
- There is no page layout, so page breaks are written as marker lines or form feed characters.
PDF (Portable Document Format) was created by Adobe in 1993 and has been an ISO standard since 2008. A PDF looks the same on every device, which is why it is used for contracts, invoices, forms, manuals and scanned documents.
- A page can hold text, vector graphics and images, each placed exactly.
- Scanned documents are usually one image per page.
- A PDF can be protected with a password that is needed to open or edit it.
Frequently asked questions
Is my text file uploaded?
No. The file is read and laid out by your browser on your own device, and the PDF is written by the browser's print function. Nothing is sent to a server.
Can I select and search the text in the PDF?
Yes. The browser writes the text as real text, not as an image, so you can search, select and copy it, and screen readers can read it.
Does it work on a phone?
Yes. On an iPhone or iPad the print screen has a Share button where you can save the PDF to Files. On Android, choose "Save as PDF" as the printer.
Can I convert several text files into one PDF?
The tool takes one file at a time. Convert each file, then put the PDFs together with the Merge PDF tool.