How to Create a Text File on Any Device or Operating System
Text files are one of the most fundamental building blocks of computing. Whether you're jotting down notes, writing a script, storing configuration settings, or prepping data for another application, knowing how to create a text file is a genuinely useful skill — and the method varies more than most people expect.
What Is a Text File, Exactly?
A text file is a file that stores plain, unformatted characters — letters, numbers, symbols, and line breaks — with no embedded styling, fonts, or images. The most common format is .txt, though other plain-text formats exist (.csv, .log, .md, .html, and .json are all technically text files at their core).
The key distinction is between plain text and rich text:
| Format | Examples | Stores Formatting? |
|---|---|---|
| Plain text | .txt, .csv, .log | No |
| Rich text | .docx, .rtf, .odt | Yes |
| Markup text | .html, .md, .xml | Text + markup syntax |
When people say "create a text file," they almost always mean a plain .txt file — no bold, no font sizes, no embedded objects. Just characters.
How to Create a Text File on Windows
Windows has had a built-in plain text editor — Notepad — since the earliest versions of the OS. It's still the fastest route for most users.
Method 1: Via Notepad
- Press Windows key + S, type Notepad, and hit Enter
- Type your content
- Go to File → Save As
- Choose a location, name your file, and make sure the file type is set to Text Documents (*.txt)
- Click Save
Method 2: Right-click on the Desktop or in File Explorer
- Right-click any empty space in a folder or on the desktop
- Select New → Text Document
- Name the file and press Enter
- Double-click to open it in Notepad and start editing
This second method is particularly quick when you already know where you want the file to live.
⚠️ One common trap: if file extensions are hidden in Windows, you might accidentally name a file something like notes.txt.txt without realizing it. You can toggle extension visibility under View → Show → File name extensions in File Explorer (Windows 11) or View → Options in Windows 10.
How to Create a Text File on macOS
Mac users have TextEdit as their default option, but it opens in rich text mode by default — which can cause issues if you need a true plain text file.
Using TextEdit in plain text mode:
- Open TextEdit (found in Applications or via Spotlight)
- Go to Format → Make Plain Text (or press Shift + Command + T)
- Type your content
- Save with Command + S — the file will save as .txt
Alternatively, you can change TextEdit's default format to plain text permanently under TextEdit → Preferences → New Document → Plain Text.
Mac users comfortable with the Terminal can also create a text file instantly with a single command:
touch filename.txt This creates an empty file. To create one with content, you'd use a command-line editor like nano or redirect output with echo.
How to Create a Text File on Linux
Linux users typically have the most options. The Terminal is the most direct route:
nano filename.txt This opens the nano editor where you can type content and save with Ctrl + O. Other popular terminal editors include vim and gedit.
Most Linux desktop environments also include a graphical text editor (such as gedit on GNOME or Kate on KDE) that works similarly to Notepad or TextEdit.
How to Create a Text File on a Smartphone or Tablet 📱
Mobile devices don't ship with native plain text editors the way desktops do. Options typically include:
- iOS: Apps like Textastic, 1Writer, or even the Notes app (though Notes saves in its own format, not .txt natively)
- Android: Apps like Simple Text Editor, Jota+, or Acode for plain .txt creation
- Google Docs / Microsoft Word mobile: These save as rich text formats by default, not plain text
If you need to create a .txt file specifically on mobile — say, for uploading to a server or syncing with a desktop workflow — a dedicated plain-text app is worth installing.
Creating Text Files Programmatically
Developers often need to create text files through code rather than manually. In Python, for example:
with open("filename.txt", "w") as f: f.write("Your content here") Similar functionality exists in virtually every programming language. The underlying concept is the same: open a file handle, write plain character data, and close the file.
The Variables That Shape Your Approach
The "right" way to create a text file depends on several factors that vary by user:
- Operating system — Windows, macOS, Linux, iOS, and Android each have different native tools
- Use case — a quick personal note has different requirements than a config file for a server or a data export for a spreadsheet
- Technical comfort level — GUI editors are friendlier; terminal commands are faster once you know them
- File destination — local storage, a cloud sync folder (like Dropbox or Google Drive), or a remote server all involve slightly different workflows
- Encoding requirements — most users never need to think about this, but some systems require files saved in specific encodings like UTF-8 or ASCII, which can be set in editors like Notepad++ or VS Code
A developer managing server config files, a student keeping study notes, and a data analyst exporting structured data are all "creating text files" — but their ideal tools, save locations, and file naming conventions may look quite different.