Create TXT File on Mac: 5 Easy Ways
To create a TXT file on a Mac, you can use the built-in TextEdit app, the Terminal command line, or a quick Automator or Shortcuts workflow. The fastest method is opening TextEdit, choosing File > New, typing your text, and saving it with a .txt extension.
Why You Might Need a Plain Text File
Plain text files (with the .txt extension) contain only unformatted characters — no bold, italics, fonts, or images. They are universally readable by any operating system, from macOS and Windows to Linux and even old mobile devices. This makes them ideal for configuration files, quick notes, programming scripts, or data exchange between different software. Unlike rich text documents (like Word or Pages), a TXT file is small, fast to open, and never changes appearance across platforms.
Method 1: Using TextEdit (The Easiest)
TextEdit is Apple’s built-in text editor, and it can create both rich text and plain text files. To ensure you’re creating a plain TXT file, follow these steps:
- Open TextEdit from the Applications folder or via Spotlight (press Cmd+Space, type “TextEdit�).
- In the menu bar, click Format and select Make Plain Text (or press Shift+Cmd+T). If you skip this, TextEdit will save as a rich text file by default.
- Type your content.
- Press Cmd+S to save. In the dialog, name your file (e.g.,
notes.txt) and choose a location. If you don’t add the.txtextension manually, macOS will add it automatically because you’re in plain text mode.
If you want TextEdit to always create plain text files, go to TextEdit > Settings > New Document and select “Plain text� under Format. This saves you from pressing the shortcut every time.
Method 2: Using Terminal (Command Line)
For users comfortable with the command line, Terminal can create a TXT file in seconds. Open Terminal (found in Utilities folder or via Spotlight). Then use one of these commands:
touch filename.txt— creates an empty TXT file.echo "Your text here" > filename.txt— creates a file with that text.cat > filename.txt— lets you type directly; press Ctrl+D to save and exit.
For example, to create a file named todo.txt in your home folder, type touch ~/todo.txt. To add text later, use nano filename.txt to open a simple editor inside the terminal.
Method 3: Using Automator or Shortcuts
If you need to create TXT files repeatedly, you can automate the process. On macOS Ventura and later, the Shortcuts app offers a “Create Text File� action. In earlier versions, Automator can do the same:
- Open Automator and create a new Quick Action (or “Service�).
- Add a “Run Shell Script� action with the command
touch "$1.txt"or use the “New Text File� action if available. - Save it and assign a keyboard shortcut in System Settings > Keyboard > Shortcuts.
This is overkill for a single file, but useful if you’re a writer or developer who needs a new text file dozens of times a day.
Common Mistakes and How to Avoid Them
Many Mac users accidentally create a Rich Text Format (RTF) file instead of a TXT file. This happens because TextEdit defaults to rich text. The file looks similar but contains hidden formatting codes and has a larger size. To check, right-click the file and select Get Info; the “Kind� should say “Plain Text� or “Text Document�. If it says “Rich Text Document�, you need to re-save it as plain text.
Another mistake is naming the file with a space or special character that causes issues in scripts (e.g., my notes.txt is fine, but my:notes.txt is not). Stick to letters, numbers, hyphens, and underscores.
Comparing TextEdit with Other Editors
TextEdit is fine for simple notes, but power users often prefer third-party editors like Sublime Text, Atom, or Visual Studio Code. These offer syntax highlighting, line numbers, and find-and-replace with regular expressions. For a quick note, TextEdit is faster and uses no extra resources. For coding or large text files, a dedicated editor is more efficient. The choice depends on your needs — if you’re just jotting down a shopping list, TextEdit is perfect.
Frequently Asked Questions
How do I create a .txt file on a Mac without TextEdit?
Use Terminal with the touch command, or use any text editor like Notes (but export as text), or use a third-party app. The simplest no-install method is Terminal: open it and type touch filename.txt in the folder where you want the file.
Why does my TextEdit file save as .rtf instead of .txt?
Because TextEdit is in Rich Text mode by default. Switch to Plain Text via Format > Make Plain Text before saving, or change the default in TextEdit > Settings > New Document. If you already saved as RTF, you can convert it by opening the file, pressing Shift+Cmd+T, and re-saving.
Can I create a TXT file on a Mac using Pages or Word?
Yes, but it’s not direct. In Pages, go to File > Export To > Plain Text and choose TXT. In Microsoft Word, use File > Save As and select “Plain Text (.txt)� from the format dropdown. However, both may strip formatting and warn you about compatibility.
How do I create a TXT file on a Mac with a specific encoding (UTF-8)?
TextEdit saves as UTF-8 by default, which is the most compatible. In Terminal, you can specify encoding with echo 'text' > file.txt which uses your terminal’s encoding (usually UTF-8). For more control, use a text editor like BBEdit or Visual Studio Code and set the encoding in the status bar.
Is there a keyboard shortcut to create a new TXT file in Finder?
No native shortcut exists. You can create a Quick Action in Automator or Shortcuts and assign a shortcut, but Finder itself doesn’t have a built-in “New Text File� like Windows Explorer does. The closest is pressing Cmd+Shift+N to create a new folder, not a file.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.