Share a Plain Text File From Your iPhone With the Share Sheet
To share a plain text file from your iPhone, open the Files app, touch and hold the file, tap Share, pick a destination such as AirDrop, Messages or Mail, and tap Send. The other person or app receives a copy of the file.
That's the whole gesture. Three details are worth knowing: what a copy means, when a link is the better choice, and what "plain text" promises the receiving app.
Quick answer
- Open Files and find the
.txt(or.md) file. - Touch and hold the file, then tap Share.
- Choose a way to send it, such as AirDrop, Messages or Mail.
- Tap Send.
Apple's guide to sending files from the Files app describes the same sequence.
Share a text file from the Files app
The steps
Touch and hold the file you want to send, then tap Share. The share sheet lists the ways you can send it, for example AirDrop, Messages or Mail. Pick one and tap Send. The file itself doesn't change. The destination gets the same characters you see when you open it.
AirDrop
AirDrop is the quickest route to a nearby device. Per Apple's AirDrop instructions, both devices need Wi-Fi and Bluetooth turned on and should be within about 30 feet (10 meters), with AirDrop enabled. Tap the AirDrop icon in the share sheet, then tap the nearby recipient.
Make it smaller first
If you are sending many files or one large one, tap Compress before you tap Share. Files creates a ZIP file; touch and hold the ZIP and share that instead. A short note rarely needs it. A folder of logs often does.
Send a copy or share a link
Files stored in iCloud Drive give you a second choice. In the share sheet, the menu under the item's title lets you pick Share a Link or Send a Copy, as described in Apple's guide to sharing files and folders in iCloud Drive.
- Send a Copy hands over a separate file. After that, your version and theirs drift apart.
- Share a Link keeps one file in your iCloud Drive. You choose who can open it (people you choose, or anyone with the link) and whether they can edit or only view and download. Changes show up for everyone.
One caution from Apple: if you move a shared file to another folder or location, the link stops working and people lose access. Pick a permanent home for the file before you send the link.
If the other person will be editing, a link avoids version confusion. We've also covered how to edit text files in iCloud Drive without making a copy.
What the other app receives
A plain text file is a sequence of characters with no fonts, colors or layout. RFC 2046 calls text/plain the simplest and most important subtype of text: no formatting commands, meant to be displayed as-is.
Encoding is the one thing that can still go wrong. The same RFC says that when no charset is stated, US-ASCII must be assumed, and it strongly recommends that new software states the charset explicitly. Today, plain text usually implies UTF-8, so save your file as UTF-8 and accented letters, CJK characters and emoji should survive the trip.
Other everyday formats are plain text underneath, too. A .vcf file is plain text, and so is a CSV or a Markdown file, which is why they pass between apps so easily.
Common problems and fixes
- The receiving app is not in the list. Apps list themselves only for file types they accept. Send the file through AirDrop, Mail or Messages instead, and open it from there.
- Characters look garbled. The receiver guessed the wrong encoding. Re-save the file as UTF-8 and send it again.
- The file is too big to send. Use Compress and share the ZIP.
- A shared link stopped working. The file was probably moved. Share the link again from its new location.
- Pasted columns collapse. Tabs can get converted along the way; tab-separated text pastes cleanly in most places, so check the delimiter first.
Plain text has limits: no images, no fonts, no layout. If you need those, you need a different format.
Doing this with Carets
A text file is easiest to share when you can find it fast. Carets is a fast, native notes and code editor for iPhone, iPad and Mac. It handles Markdown, plain text and code in one editor, with syntax highlighting for code and config files, and it organizes your work into files, projects and tags, so the file you want to send is easy to locate.
Your files stay plain text, which keeps them portable: anything you can open in Carets is something another app can read, as described above. Carets is built natively for iOS and Mac, not as a web wrapper.
Get Carets on the App Store for iPhone, iPad and Mac.
Frequently Asked Questions
How do I share a .txt file from my iPhone to another app?
Open Files, touch and hold the file, tap Share, and pick a destination such as AirDrop, Messages or Mail, then tap Send. The destination receives a copy.
Does sharing a text file send a copy or the original?
A plain Share sends a copy. For files in iCloud Drive you can instead choose Share a Link, which keeps one file that changes show up in. Moving the file breaks the link.
What is text/plain?
It is the MIME subtype for text with no formatting directives, meant to be displayed as-is. RFC 2046 assumes US-ASCII when no charset is stated; today plain text usually implies UTF-8.
Can I make a text file smaller before sending it?
Yes. In Files, tap Compress before Share to make a ZIP file, then share the ZIP.