To convert a TXT file to PDF on a Mac, open it in TextEdit and choose File > Export as PDF. On iPhone or iPad, paste the text into a note, tap the Share button, tap Markup, then tap Done to save the note as a PDF. On Windows, open the file in Notepad, choose Print and pick Microsoft Print to PDF. Rich text (RTF) files work the same way on all three. Online converters also work, but they upload your file to someone else's server.
Updated 7 November 2026. The Apple steps below were checked against Apple's TextEdit User Guide, the iPhone User Guide (iOS 27) and the Mac User Guide on 7 November 2026. The command-line results come from our own test on macOS 15.6 the same day. Need a PDF from something other than text? See how to make a PDF on Mac and how to make a PDF on iPhone.
TXT, text and rich text: what you are converting
A .txt file is plain text. It stores characters and line breaks and nothing else: no font, no bold, no page size. Whatever app opens it decides how it looks. A .rtf file (Rich Text Format) also stores fonts, sizes, bold, italics, colours and simple tables. When people search for "text to PDF format" they usually mean one of these two, or text copied from a website, an email or a chat.
A PDF fixes the layout. Once you convert, the text sits on pages of a set size with a set font, and it looks the same on every device. That is why forms, applications and archives ask for PDF instead of .txt. If the PDF is made from real text (all methods below do this), the words stay selectable and searchable.
TXT to PDF methods compared
| Method | Platform | Keeps text searchable | Control over font and page | File leaves your device |
|---|---|---|---|---|
| TextEdit, File > Export as PDF | Mac | Yes | Font, size, page setup | No |
| Print > PDF > Save as PDF | Mac (any app) | Yes | Paper size, scale, margins via the app | No |
cupsfilter in Terminal | Mac | Yes | Little: default font, US Letter in our test | No |
| Notes, Share > Markup > Done | iPhone, iPad | Yes | Note formatting only | No (iCloud if your notes sync) |
| Print preview, then Share | iPhone, iPad | Yes | Little | No |
| Notepad, Print > Microsoft Print to PDF | Windows | Yes | Font and page setup in Notepad | No |
| Word or Pages, save or export as PDF | Mac, Windows, iPhone | Yes | Full: fonts, margins, headers | No (unless saved to the cloud) |
| Online converter | Any browser | Usually | Varies | Yes, uploaded |
| PDF Opus | Mac, iPhone, iPad | Yes | Text, Markdown, HTML and Office files to PDF | No |
How to convert TXT to PDF on Mac with TextEdit
TextEdit comes with every Mac and opens plain text, rich text, Word, OpenDocument and HTML files. Apple's TextEdit guide lists "Create a PDF: Choose File > Export as PDF."
- Control-click the .txt file in Finder and choose Open With > TextEdit.
- Check the look. A plain text file uses TextEdit's plain text font. To change fonts, choose Format > Make Rich Text first, then Format > Font > Show Fonts.
- Choose File > Page Setup to pick the paper size (US Letter or A4) and orientation.
- Choose File > Export as PDF.
- Name the file, choose a folder and click Save.
For an RTF file the steps are the same, and the PDF keeps the fonts, colours and tables from the document. If you converted plain text to rich text in step 2, close the original without saving if you want the .txt to stay as it was. Apple notes that turning a rich text document into plain text removes all styles, so do not go the other way on a file you want to keep formatted.
Use Print to PDF for more page options
The print route gives you the print dialog's options, such as scale and pages per sheet. In TextEdit (or any Mac app):
- Choose File > Print.
- Set the paper size and scale.
- Click the PDF button at the bottom left, or open the PDF pop-up menu and choose Save as PDF.
- Enter a name, choose a location and click Save. Security Options in the same dialog can add a password to open, copy or print the PDF.
The full walkthrough, including the other items in the PDF menu, is in how to print to PDF on Mac.
Convert TXT to PDF in Terminal (many files at once)
macOS includes the printing system's cupsfilter tool, which turns a text file into a PDF without opening any app:
cupsfilter notes.txt > notes.pdf
In our test on macOS 15.6 on 7 November 2026, a two-line text file became a one-page US Letter PDF with selectable text. To convert every .txt file in a folder, run for f in *.txt; do cupsfilter "$f" > "${f%.txt}.pdf"; done in that folder. You get no say over the font, so use TextEdit when the look matters. macOS also includes textutil, which converts text between formats such as RTF, HTML and Word (textutil -convert rtf notes.txt), but it does not write PDF.
How to convert text to PDF on iPhone and iPad
The Preview app on iPhone (iOS 26 and later) opens PDFs and images, and Apple's guide does not list text files. So on iPhone the documented route goes through Notes.
With Notes (documented by Apple)
- Open the .txt file in the Files app, touch and hold the text, tap Select All and then Copy. For text from a website or email, select and copy it there.
- Open Notes, create a new note and paste.
- Tap the Share button, then tap Markup. If you do not see Markup, tap View More first.
- Mark up the pages if you want, then tap Done to save the PDF.
Apple's iPhone User Guide describes this as "Export a note as a PDF". The PDF uses the note's own formatting. Use Notes' text styles (Title, Heading, Body, Monospaced) before you export if the layout matters. On iPad the steps are the same.
With the print preview
Many apps that show a text file, including Files, offer Print in the Share menu. The print preview is a PDF. On recent iOS versions you can tap the Share button in the print options to save that preview to Files. This trick is widely used but is not described in Apple's guide, so the exact buttons can differ by iOS version.
With Pages or Word on iPhone
If you already use Pages or Microsoft Word on your iPhone, paste the text into a new document and export it as PDF. You get full control over fonts and margins. Pages exports PDF from its More menu (Export > PDF).
What the built-in methods do not do
- No batch conversion on iPhone. Every file goes through Notes or the print preview one at a time.
- No font control for plain text in one step. On Mac you first turn the file into rich text;
cupsfiltergives no font choice at all. - Long lines get wrapped. Log files and CSV data wrap at the page edge, which breaks columns.
- No Markdown rendering. A .md file converts as raw text with its # and * characters.
- Encoding guesses. TextEdit guesses the encoding of old text files and can show wrong characters (fix below).
How to convert TXT to PDF on Windows
Notepad and Microsoft Print to PDF
- Open the .txt file in Notepad.
- Optional: change the font (in the Format or settings menu, depending on your Windows version) and the page setup.
- Press Ctrl+P.
- Choose Microsoft Print to PDF as the printer and click Print.
- Name the PDF and choose where to save it.
Microsoft Print to PDF is a virtual printer that ships with Windows 10 and Windows 11. Every app that can print can use it.
Microsoft Word
Word opens .txt and .rtf files. Open the file, adjust the font and margins, then choose File > Save As and pick PDF as the file type (on a Mac, File > Save As and File Format: PDF). This is the best built-in option for RTF files with tables, and for text you want to format as a real document. See how to convert Word to PDF on Mac for the Word export options.
Online TXT to PDF converters: the privacy trade-off
Online converters take a .txt or .rtf file in the browser and return a PDF. They are handy on a shared or locked-down computer. The trade-off: your file is uploaded to the vendor's servers and processed there. Most vendors state a deletion period; iLovePDF, for example, says uploaded files are deleted automatically after two hours (its security page, checked 7 November 2026). For notes, passwords, logs with customer data or anything private, use one of the on-device methods above instead. More in are online PDF editors safe.
Fix common TXT to PDF problems
Strange characters (é, ’ or boxes) in the PDF
The text was saved in one encoding and opened in another. In TextEdit, open the file with File > Open, select it, and pick the right encoding (usually UTF-8, or Western Windows Latin 1 for old Windows files) in the Plain Text Encoding menu at the bottom of the dialog before you click Open. If you open files by double-clicking, change the default in TextEdit > Settings > Open and Save. Then export again.
Columns in a log or table no longer line up
Plain text tables rely on a monospaced font, where every character has the same width. Make the document rich text and set a monospaced font such as Menlo or Courier, or use Notes' Monospaced style on iPhone. If lines still wrap, switch to landscape in Page Setup or lower the font size.
Very long lines run off the page
In TextEdit, choose Format > Wrap to Page so the window shows the page width and the wrapping you will get in the PDF.
The PDF is US Letter and you need A4 (or the other way round)
Set the paper size in File > Page Setup before exporting. The cupsfilter route used US Letter in our test, so use TextEdit for A4.
The text is not searchable in the PDF
All methods above produce real text. If search fails, the PDF was made from a screenshot or photo of the text. Convert from the original file, or run text recognition: see how to make a PDF searchable (OCR).
Going the other way: PDF to TXT
To get plain text back out of a PDF, see how to convert PDF to text on Mac.
Tips for a better-looking text PDF
- Add a title. A plain text file has no heading. Type one at the top and make it bold in rich text.
- Pick a readable size. 11 or 12 point for body text prints well on both Letter and A4.
- Use monospaced fonts for code and logs only. Prose reads better in a proportional font.
- Name the file well. "2026-11-07 meeting notes.pdf" sorts by date and is easy to find.
- Check page breaks. Use Print preview to see where pages split before you save.
PDF Opus: the best app for converting text to PDF (top pick)
The best app for converting text to PDF is PDF Opus. It converts Word, Excel, PowerPoint, HTML, Markdown, plain text and images to PDF on your device, on iPhone, iPad and Mac. A Markdown file comes out with real headings and lists instead of raw # signs, and HTML keeps its basic styling. Nothing is uploaded: your documents are processed on your device, and the app goes online for purchases, licence checks and update checks. After converting, you can merge the result with other PDFs, add page numbers, compress it or protect it with a password in the same app.
Limits worth knowing: right-to-left and complex scripts are not shaped, multi-column layouts flow as one column, and legacy .doc files are not supported.
Frequently asked questions
How do I convert a TXT file to PDF?
On a Mac, open the file in TextEdit and choose File > Export as PDF. On Windows, open it in Notepad, press Ctrl+P and choose Microsoft Print to PDF. On iPhone, paste the text into a note, tap Share, tap Markup, then Done.
How do I convert text to PDF format for free?
All built-in methods cost nothing: TextEdit or Print to PDF on Mac, Notes on iPhone and iPad, Notepad with Microsoft Print to PDF on Windows. Free online converters exist too, but they upload the file.
How do I convert rich text (RTF) to PDF?
Open the .rtf file in TextEdit on a Mac or in Word on Windows and Mac, then use Export as PDF (TextEdit) or Save As PDF (Word). Fonts, colours and simple tables carry over.
Can I convert TXT to PDF on iPhone without an app?
Yes. Copy the text into Notes, tap the Share button, tap Markup and tap Done. Notes saves the note as a PDF.
Will the text in the PDF be searchable?
Yes, with every method in this guide, because the PDF is built from the real text. Only PDFs made from photos or screenshots of text need OCR.
How do I convert many TXT files to PDF at once on a Mac?
In Terminal, go to the folder and run for f in *.txt; do cupsfilter "$f" > "${f%.txt}.pdf"; done. Each file becomes its own PDF with the default font.
Why does my PDF show strange characters?
The text file's encoding was misread. Reopen it in TextEdit with the right encoding (often UTF-8) chosen in the Open dialog, then export again.
How do I convert a PDF back to TXT?
Select all the text in the PDF and paste it into a plain text document, or use a PDF-to-text converter. Scanned PDFs need OCR first. Details in our PDF to text guide linked above.