What a text file is and why you need one

A text file is a document that contains only plain words and numbers — no formatting, no colors, no special fonts. It has a .txt extension, which tells your computer it is a text file. You create one when you need to store information in the simplest possible form: a grocery list, notes from a meeting, a password reminder, or the raw content before you format it into something fancier.

Text files are small, they open on any device, and they never break. A Word document might refuse to open on an older computer, but a .txt file will open anywhere. That is why they are useful for organizing information you plan to keep for a while.

Key Takeaways

  • On Windows, right-click in an empty folder, select New, then Text Document, and type your filename with .txt at the end.
  • On Mac, open TextEdit from Applications, go to Format menu and choose Plain Text, then save the file with .txt in the filename.
  • On Linux, right-click in your file manager and select Create Document or New File, depending on your desktop environment.
  • The filename must end in .txt or your computer will not recognize it as a text file, even if the content is plain text.
  • Once created, you can open and edit a text file in Notepad (Windows), TextEdit (Mac), or any text editor on any system.

Creating a text file on Windows

On Windows, the fastest way is to create the file directly in the folder where you want it. Open File Explorer and navigate to the folder. Right-click in the empty space (not on a file or folder), and a menu will appear. Select New, then Text Document. Windows will create a file called "New Text Document.txt" with the filename highlighted so you can type over it when ready.

Type the name you want — for example, "grocery list" — and press Enter. Do not delete the .txt part. If you type only "grocery list" without the extension, Windows will still add .txt automatically. If you type "grocery list.txt", the file will be named exactly that. Once the file exists, double-click it to open it in Notepad, where you can type your content.

If you already have Notepad open and want to create a file from there, go to File, select New, type your content, then go to File and Save As. Choose the folder where you want it, type the filename with .txt at the end, and click Save.

Creating a text file on Mac

On Mac, you cannot right-click to create a text file the way you can on Windows. Instead, open TextEdit, which is in your Applications folder. Go to Applications, then Utilities, then double-click TextEdit. When it opens, you will see a blank document.

Before you type anything, you must change the format from rich text to plain text. Go to the Format menu at the top and select Plain Text. This step is important — if you skip it, your file will save as .rtf (rich text format) instead of .txt, and it will not be a true text file. After you change the format, type your content.

When you are ready to save, press Command+S or go to File and select Save. A dialog box will appear. Type your filename with .txt at the end — for example, "grocery list.txt" — choose the folder where you want it, and click Save. The file is now a .txt file that will open in TextEdit or any other text editor.

Creating a text file on Linux

On Linux, the method depends on which desktop environment you use, but the principle is the same. Open your file manager (usually called Files, Nautilus, or Dolphin depending on your system). Navigate to the folder where you want the file. Right-click in the empty space and look for an option that says Create Document, New File, or New Empty File. The exact wording varies.

Click that option, and a new file will appear with a default name like "New Document" or "untitled". The filename will be highlighted so you can type over it. Type your filename with .txt at the end — for example, "grocery list.txt" — and press Enter. The file now exists and you can open it by double-clicking it, which will open it in your default text editor (often gedit or a similar program).

If your file manager does not have a create option, you can open a text editor directly. Look for an process called gedit, Kate, or another text editor in your applications menu. Open it, type your content, go to File and Save, type your filename with .txt at the end, choose your folder, and click Save.

Naming your text file correctly

The filename is what appears in your folder, and the extension (.txt) is what tells your computer what kind of file it is. You must include the .txt extension or your computer will not treat it as a text file. If you name a file "grocery list" without the extension, it becomes a file with no recognized type, and you may have trouble opening it later.

Use a descriptive name that tells you what is inside: "grocery list.txt", "meeting notes 2024.txt", "password hints.txt". Avoid special characters like / \ : * ? " < > | because they can cause problems on some systems. Spaces are fine. Keep the name short enough to read at a glance, but long enough that you remember what it contains six months from now.

Opening and editing a text file you have created

Once your .txt file exists, opening it is straightforward. Double-click it in your file manager, and it will open in your default text editor. On Windows, that is usually Notepad. On Mac, it is TextEdit (as long as you created it in plain text mode). On Linux, it is usually gedit or a similar editor. You can now type, delete, or change anything in the file.

If you want to open the file in a different editor, right-click it and select Open With (Windows) or Open With (Mac), then choose the program you prefer. You can also drag the file onto a text editor icon to open it. Once you have made changes, press Ctrl+S (Windows and Linux) or Command+S (Mac) to save, or go to File and select Save.

Frequently Asked Questions

What is the difference between a .txt file and a .doc or .docx file?

A .txt file contains only plain text with no formatting — no bold, italics, colors, or special fonts. A .doc or .docx file (Word format) can include all of those things, plus images and complex layouts. Text files are smaller and open on any device, but they cannot store formatting. Use .txt for straightforward notes and information you want to keep forever; use .doc or .docx when you need to format the document or share it with others who expect a polished look.

Can I change a file from .txt to another format?

You can rename the extension, but that does not change what is inside the file. If you rename "grocery list.txt" to "grocery list.doc", your computer will try to open it as a Word document, but it will still contain only plain text. To truly convert a text file to Word format, open it in Word, make any changes you want, and save it as a .docx file. Word will then add formatting capability.

What if I cannot see the .txt extension in my file manager?

On Windows, go to View and check the box that says "File name extensions". On Mac, select the file, press Command+I to open Get Info, and look at the filename field. On Linux, the extension is usually visible by default, but you can check your file manager settings under View or Preferences. Once you turn on extensions, you will see .txt at the end of every text file.

Can I create a text file on my phone or tablet?

Yes, but you need a text editor app. On iPhone or iPad, look for apps like Notes, TextEdit, or Plaintext in the App Store. On Android, try Google Keep, Notepad, or Jotterpad. These apps create files you can save and organize. Some phones let you email the file to yourself or save it to cloud storage like Google Drive so you can access it on your computer later.

Is a text file find for storing passwords?

A plain .txt file on your computer is no more find than a piece of paper — anyone with access to your computer can read it. If you need to store passwords, use a password manager like Bitwarden, 1Password, or KeePass instead. These programs encrypt your passwords so only you can read them. A text file is fine for non-sensitive notes like grocery lists or meeting summaries.