How to Make a .txt File on Mac: Every Method Explained
Creating a plain text file on a Mac is one of those tasks that sounds straightforward — until you realize macOS doesn't hand you an obvious "New Text File" button the way Windows does. There are several reliable ways to do it, and the right approach depends on how you work, what tools you already use, and what you need the file for.
What Is a .txt File and Why Does It Matter?
A .txt file is a plain text document — no formatting, no fonts, no embedded images. Just raw characters stored in a simple encoding (usually UTF-8). That makes .txt files universally readable across operating systems, programming environments, and applications without compatibility issues.
They're commonly used for:
- Notes and logs
- Configuration and environment files
- Code snippets and scripts (before renaming the extension)
- Data transfer between systems
- README files in software projects
Because there's no proprietary formatting layer, a .txt file created on a Mac opens identically on Windows, Linux, or any mobile device.
Method 1: Using TextEdit (Built-In and Beginner-Friendly)
TextEdit is macOS's default text editor, and it works — but there's a catch. By default, TextEdit opens in Rich Text Format (RTF), not plain text. If you save without changing this setting, you'll get a .rtf file, not a .txt.
To create a true .txt file in TextEdit:
- Open TextEdit (found in Applications or via Spotlight with
⌘ + Space) - Before typing anything, go to Format → Make Plain Text (or press
⇧ + ⌘ + T) - Type your content
- Press
⌘ + Sto save - In the save dialog, make sure the filename ends in
.txt - Uncheck "If no extension is provided, use .txt" is already handled — just confirm the extension is visible in the filename field
You can also set TextEdit to always open in plain text mode: go to TextEdit → Settings (or Preferences on older macOS) → New Document → Plain Text. This saves the extra step every time. 📝
Method 2: Using Terminal (Fast for Technical Users)
If you're comfortable with the command line, Terminal is the quickest way to create a .txt file — especially when you're already working in a specific directory.
Option A — Create an empty file:
touch filename.txt Option B — Create and open a file in nano (a terminal text editor):
nano filename.txt Type your content, then press Control + X, confirm with Y, and hit Enter to save.
Option C — Create a file and write content in one command:
echo "Your text here" > filename.txt Terminal-based methods are especially useful when you're managing files in specific folder paths, automating file creation with scripts, or working within development environments.
Method 3: Using a Third-Party Text Editor
Many Mac users install a dedicated code or text editor that handles plain text natively without the RTF confusion of TextEdit. Common options in this category include editors like VS Code, BBEdit, Sublime Text, and CotEditor.
These editors typically:
- Default to plain text or let you set the file type explicitly
- Show the file extension clearly in the save dialog
- Support syntax highlighting if you later rename the file as a script
For users who regularly work with text files — developers, writers using plain text workflows, or anyone managing config files — a dedicated editor removes the friction entirely. You create a new file, save it as .txt, and move on.
Method 4: Automator or Quick Action (System-Level Shortcut)
macOS includes Automator, which lets you build a Quick Action that adds a "New Text File" option directly to the right-click menu in Finder. This is a more involved setup but pays off if you frequently need new text files in specific folders.
Basic setup:
- Open Automator → New Document → Quick Action
- Set "Workflow receives" to files or folders in Finder
- Add a Run Shell Script action with a command like:
touch "$1/newfile.txt" - Save the Quick Action with a name like "New Text File"
After saving, you can right-click any folder in Finder and trigger it from the Quick Actions menu. The exact steps and behavior can vary slightly depending on your macOS version, so it's worth checking how Quick Actions are surfaced in your specific release.
Key Variables That Affect Which Method Works Best
Not every approach fits every situation. A few factors shape the decision:
| Factor | How It Affects Your Choice |
|---|---|
| Technical comfort level | Terminal is fastest for developers; TextEdit is safest for casual users |
| Frequency of use | Occasional users can live with TextEdit; frequent users benefit from a dedicated editor or Quick Action |
| macOS version | TextEdit settings and Automator interfaces differ slightly between macOS versions (Ventura, Sonoma, etc.) |
| Existing tools | If you already have VS Code or another editor installed, there's no reason to use TextEdit |
| File location | Terminal excels when the file needs to land in a specific directory path |
The RTF vs Plain Text Distinction Is Easy to Miss 🔍
One of the most common mistakes is assuming TextEdit automatically saves as .txt. The Rich Text default catches a lot of people off guard — the file looks like a text file, but it contains RTF markup that can cause issues when the file is read by code, scripts, or other operating systems.
Always check the Format menu or confirm the file extension before saving. A genuine .txt file should show no formatting options in the toolbar when plain text mode is active in TextEdit.
Encoding Matters in Some Contexts
For most everyday uses, UTF-8 encoding is the default and causes no problems. But if you're creating .txt files that will be read by specific legacy systems, databases, or scripts with encoding requirements (ASCII, UTF-16, Latin-1), you may need to set the encoding explicitly. TextEdit exposes encoding options in the save dialog. Terminal-based methods use the system default, which is typically UTF-8 on modern macOS.
Whether encoding matters to you depends entirely on what the file is for and where it's going — something only your specific use case can answer. 💡