What a text file is and why Windows uses them
A text file is a document that contains only letters, numbers, and symbols — no formatting like bold, colors, or fonts. Windows recognizes text files by the .txt extension at the end of the filename, like notes.txt or instructions.txt. Because text files are straightforward and small, they work on any device and any operating system without compatibility problems.
Windows uses text files for many things: configuration settings that programs read when they start, lists of data that other software processes, log files that record what happened when something went wrong, and straightforward notes you want to keep. You can create a text file in seconds and open it with any program that reads plain text.
The simplicity is the point. A text file has no hidden formatting, no embedded images, no macros — just the words themselves. This makes text files reliable for storing information that needs to move between different programs or devices without losing anything in translation.
Key Takeaways
- Open any .txt file by double-clicking it, or right-click and choose Notepad to edit it.
- Create a new text file by right-clicking in an empty space, selecting New, then Text Document.
- Save changes in Notepad by pressing Ctrl+S, and Windows will keep the .txt extension automatically.
- Text files work on any device because they contain only plain text with no special formatting or hidden data.
- Some programs create .txt files to store settings or logs, so you may need to open them to troubleshoot problems.
Opening a text file you already have
If you have a .txt file on your computer, the fastest way to open it is to find the file and double-click it. Windows will open it in Notepad, the built-in text editor that comes with every Windows installation. The file appears in a plain window with no toolbars or formatting options — just your text.
If double-clicking does not work, or if you want to open the file with a different program, right-click the .txt file and select Open with. You will see a list of programs installed on your computer that can read text. Notepad is always an option. Some people prefer other editors like WordPad (which allows basic formatting) or third-party programs, but Notepad is the standard choice for plain text.
You can also open Notepad first, then use File > Open to browse for the text file you want. This method works the same way as opening the file directly, but some people find it easier when they have many files in one folder.
Creating a new text file
To create a new text file, open File Explorer and navigate to the folder where you want to save it. Right-click in an empty area of the folder and select New. A submenu will appear with options including Text Document. Click that option.
Windows will create a file named New Text Document.txt with the name highlighted so you can type a new name when ready. Type the name you want — for example, grocery_list or passwords_backup — and press Enter. Windows keeps the .txt extension automatically, so you do not need to type it yourself.
The file is now created and ready to edit. Double-click it to open it in Notepad, type what you need, and save it. If you create the file but do not open it right away, you can open it later the same way you would open any other .txt file.
Editing and saving text files
Once you have a text file open in Notepad, editing is straightforward. Click anywhere in the text to place your cursor, then type, delete, or rearrange words the same way you would in any document. Notepad has no special formatting — you cannot make text bold or change colors. Everything you type appears in the same plain font.
To save your changes, press Ctrl+S on your keyboard. Notepad will save the file when ready with the same name and location. If you want to save the file with a different name or in a different folder, press Ctrl+Shift+S or go to File > Save As. A dialog box will open where you can type a new name or choose a new location. Make sure the file type is set to Text Documents (.txt) so Windows saves it as a text file.
If you close Notepad without saving, Windows will ask whether you want to save your changes. Click Save to keep your edits, or Don't Save to discard them. There is no undo after you close the file, so save your work if you want to keep it.
When Windows creates text files automatically
Many programs create .txt files without you asking them to. When something goes wrong with a program, it may write a log file — a text file that records what the program was doing when the error happened. These files often have names like error.txt or debug.log and are saved in the program's folder or in a logs subfolder.
Configuration files are another common type. Some programs store their settings in a .txt file so they can read the same settings every time they start. If you need to change how a program behaves, you may need to open and edit one of these files. The program's documentation will tell you which file to edit and what changes are safe to make.
Windows itself creates text files for certain tasks. System logs, batch files (which run commands automatically), and configuration files are all plain text. If someone gives you instructions to troubleshoot a problem, they may ask you to open a specific .txt file and look for certain information, or to edit a configuration file and change a specific line.
Text files versus other document types
The main difference between a .txt file and a Word document (.docx) or a Google Doc is that text files contain only the words themselves. A Word document stores formatting information — fonts, colors, bold, italics, margins — along with the text. This extra information makes Word files larger and means they only open correctly in programs that understand Word's format.
Text files are smaller and simpler. They open the same way in Notepad, in Word, on a Mac, on a phone, or on a Linux computer. Nothing gets lost or reformatted because there is nothing to reformat. This is why programmers, system administrators, and anyone who needs to share plain information often use .txt files.
If you need formatting — bold text, different fonts, colored text — you should use Word, Google Docs, or another word processor instead. If you need only the words with no special appearance, a text file is the right choice.
Frequently Asked Questions
Can I open a text file on my phone or tablet?
Yes. Text files work on any device because they contain only plain text. On an iPhone or iPad, you can open a .txt file with the Notes app or with a text editor from the App Store. On Android, the Files app or Google Drive can open text files. You can also email a text file to yourself and open it on your phone.
What if a text file opens in Word instead of Notepad?
Right-click the .txt file and select Open with, then choose Notepad from the list. If you want Notepad to be the default program for all text files, right-click, select Open with, then check the box that says Always use this app to open .txt files before clicking Notepad.
Is it safe to edit a text file that a program created?
Only if the program's documentation tells you it is safe. Configuration files and log files are usually safe to read, but editing them without knowing what you are doing can break the program. If you are unsure, make a copy of the file first so you have a backup if something goes wrong.
Can I rename a text file to change what program opens it?
Changing the extension (the .txt part) will change which program tries to open it, but this only works if the other program actually understands the file's contents. For example, renaming a .txt file to .csv might let Excel open it, but only if the text inside is formatted as comma-separated data. Renaming does not change what is inside the file.