Open TextEdit and choose Format › Make Plain Text in a new document. Type your text, then press Command + S and save it as notes.txt. If you only want an empty file and Terminal is already open, run touch notes.txt in your destination folder.
Method 1: Use TextEdit
1. Open a new document
Launch TextEdit and choose File › New. If you start from an existing document, work on a copy before removing formatting. You can paste the text you need into the new document to keep the source untouched.
2. Switch to plain text
Choose Format › Make Plain Text or press Shift + Command + T while the document is in rich-text mode. If the menu offers Make Rich Text instead, the document is already in plain-text mode. Type or paste your content. Use blank lines, spaces, or literal characters such as a dash to show structure in the saved file.
3. Save the TXT file
Choose File › Save, or press Command + S. Enter a name ending in .txt, choose a folder, and select Unicode (UTF-8) if Plain Text Encoding is offered. If macOS asks which extension to use, keep .txt. Open the destination folder in Finder to confirm the file is there before you attach or upload it.
Make plain text the default
If most files you create are logs or notes, choose TextEdit › Settings › New Document, then select Plain text under Format. In Open and Save, you can have TextEdit add the .txt extension automatically and set the encoding for saving plain text. These defaults apply to future saves. If you need a formatted document on another occasion, open a new document and switch its format individually.
Method 2: Use Terminal
- Open Terminal. Choose a writable destination. For example,
cd ~/Documentsswitches to Documents. A bare filename refers to the current folder. - Run
touch notes.txtfor an empty file. If the file already exists,touchupdates its timestamps and leaves the text in place. - To create a file with one line, run
echo "Hello" > notes.txt. The>operator replaces the contents of an existing file, so check the filename first. The output in this example includes a newline afterHello. - For several lines, open the file with
nano notes.txt. Type your text, press Ctrl + O, confirm the filename with Enter, then press Ctrl + X. If you prefer a graphical editor, runopen -e notes.txtafter the file exists to open it in TextEdit.
The same file can be edited in either app. A relative path such as notes.txt depends on Terminal's current directory, so a command run from a different folder can create a second file with the same name. If you want the filename to contain spaces, enclose it in quotes. For example, touch "meeting notes.txt" creates one file rather than treating each word as a separate argument.
Method 3: Create it online
- Go to the editor on this page and enter your text.
- Name the file and select UTF-8. Leave the line endings as LF for a typical macOS workflow or choose CRLF when the recipient requires it.
- Download the file. Open it from your browser's downloads list or find it in Finder in the folder your browser uses for downloads.
Why does Finder have no New File option?
Finder lets you organize files and create folders. For a blank document, start in the app that will create it and choose the destination when you save. If you are already working at the command line, touch puts a blank TXT in the directory you specify. These two workflows are particularly handy when you want the file to land alongside another document. Open its folder first in Terminal, or select that folder in TextEdit's save dialog.
How to open a .txt file on Mac
Double-click it in Finder. If it opens in a different app, Control-click the file and choose Open With › TextEdit. Press Space with the file selected for a quick look at the contents without editing. Use TextEdit when you need to choose an encoding.
If the text appears garbled, keep the original and reopen it from File › Open in TextEdit. Select the file, expand Show Options, and choose the source encoding from Plain Text Encoding before opening. If the sender created it using a legacy Chinese encoding, ask which one they used. Once the file displays correctly, save a separate UTF-8 copy for future use. See what a TXT file contains for examples of how different encodings store characters.
FAQ
Why did TextEdit save an RTF file?
The document was in rich-text mode when it was saved. Switch the format with Make Plain Text and save again. The converted file keeps the text but loses the formatting.
Can I send a TXT file from Mac to Windows?
Yes. UTF-8 works with modern Windows editors. If a Windows program specifies CRLF, select it when you generate the file. See how to create a text file on Windows for opening and checking it there.
Why do my lines wrap differently on another device?
An editor can wrap long lines to fit its window. Actual line breaks are stored in the file and stay in the same places. Enlarge the window to see whether a break moves with the margin.