How to Create a TXT File on Any Device or Operating System

A plain text file — saved with the .txt extension — is one of the most universally compatible file formats in computing. No special software required to open it, no hidden formatting, no proprietary encoding. Just raw characters. Whether you're storing notes, writing a script, building a config file, or logging data, knowing how to create a TXT file is a foundational skill that varies more than most people expect depending on your device and workflow.

What Is a TXT File, Really?

A TXT file stores unformatted plain text — meaning no bold, no fonts, no embedded images, no metadata beyond what the operating system tracks. It uses a basic character encoding standard, most commonly UTF-8 today, though older files may use ASCII or UTF-16.

This simplicity is the point. TXT files open in virtually any text editor, terminal, code editor, browser, or word processor on any operating system. They're also small, fast, and version-control friendly — which is why developers and sysadmins rely on them constantly.

What a TXT file is not: a Word document (.docx), a rich text file (.rtf), or a markdown file (.md). Those formats carry additional structure. A TXT file is deliberately stripped down.

How to Create a TXT File on Windows

Windows includes Notepad — a lightweight text editor that's been part of the OS since version 1.0. It's still the fastest route to a new TXT file.

Using Notepad:

  1. Press Windows + S, type Notepad, and open it
  2. Type your content
  3. Go to File → Save As
  4. Choose your folder, name the file, and confirm the file type is set to Text Documents (*.txt)
  5. Click Save

Using the right-click context menu:

  1. Navigate to any folder in File Explorer
  2. Right-click in an empty space
  3. Select New → Text Document
  4. Rename the file as needed

Using Command Prompt:

echo. > filename.txt 

This creates an empty TXT file instantly. Replace filename with your chosen name.

One thing to watch: Windows Notepad historically defaulted to ANSI encoding, which can cause issues with special characters. Modern versions of Notepad default to UTF-8, but if you're sharing files across systems, it's worth checking the encoding option in the Save As dialog.

How to Create a TXT File on macOS

macOS ships with TextEdit, but there's a catch — it defaults to Rich Text Format (.rtf), not plain text. You need to switch modes before saving.

Using TextEdit:

  1. Open TextEdit
  2. Go to Format → Make Plain Text (or press Shift + Command + T)
  3. Type your content
  4. Go to File → Save
  5. Name the file and ensure the extension is .txt — TextEdit may try to add .txt automatically, but verify it

Using Terminal:

touch filename.txt 

This creates an empty TXT file in your current directory. You can also use:

nano filename.txt 

This opens the file directly in the nano text editor inside Terminal, lets you type content, and saves it on exit (Control + X, then Y).

macOS also works well with third-party editors like BBEdit (free version available) or Visual Studio Code, both of which make plain text creation straightforward.

How to Create a TXT File on Linux

Linux users have the most flexibility here. The touch and nano commands work identically to macOS. Most Linux distributions also include graphical text editors — Gedit on GNOME, Kate on KDE, Mousepad on Xfce — all of which save as plain text by default.

touch myfile.txt nano myfile.txt vim myfile.txt 

vim and gedit are especially common in developer environments. The choice of editor rarely affects the file itself — it's still a TXT file at the end.

How to Create a TXT File on Mobile Devices 📱

Mobile is where things get less standardized.

PlatformBuilt-in OptionNotes
AndroidNo native text editor in stock AndroidFile manager apps vary; many support TXT creation
iOS / iPadOSFiles app doesn't create TXT nativelyThird-party apps like Textastic or 1Doc fill the gap
ChromeOSText editor app includedSaves as .txt by default

On both Android and iOS, apps like Markor (Android) or 1Writer (iOS) are popular for plain text editing. Google Docs and Apple Notes are not substitutes — they use proprietary formats and don't export as true .txt without an extra step.

Encoding and Line Endings: The Hidden Variables

Two factors affect how TXT files behave across systems:

  • Character encoding: UTF-8 is the safe modern default. If a file will be used on legacy systems or in older software, ASCII or UTF-16 may matter.
  • Line endings: Windows uses CRLF (), Unix/Linux/macOS use LF (). This difference is invisible to most users but can break shell scripts, config files, or code if the wrong line ending is used.

Most modern editors let you choose or convert line endings — look for options labeled EOL, line endings, or CRLF/LF in the status bar or settings.

What Your Specific Workflow Changes

Creating a TXT file is a two-minute task on any platform. But how you create it — and which tool you use — starts to matter depending on what you're doing with it. A developer managing config files across Linux servers has different needs than someone jotting quick notes on an iPad, or a data analyst creating log files for batch processing. The method that works frictionlessly in one workflow can add unnecessary steps in another.

Your OS, the tools you already use, whether the file will be shared cross-platform, and whether encoding or line endings matter for your use case — those are the variables that shape which approach actually fits your situation. 🗂️