A TXT file is plain text with no formatting — just letters, numbers, and symbols

A TXT file (or text file) is the simplest kind of computer file. It contains only text: letters, numbers, punctuation, and line breaks. Nothing else. No bold, no italics, no colors, no images, no embedded links that work when you click them. If you open a TXT file in any text editor — Notepad on Windows, TextEdit on Mac, or any other program designed to read text — you see exactly what was typed, nothing more.

The ".txt" at the end of the filename is the file extension. It tells your computer what kind of file this is and which programs can open it. Because TXT files are so straightforward, almost every device and program on earth can read them. A file you create on a Windows computer opens the same way on a Mac, on a phone, or on a Linux machine from 1995.

Key Takeaways

  • A TXT file contains only plain text with no formatting, colors, images, or special styling of any kind.
  • You can open a TXT file with any text editor, including Notepad, TextEdit, or even your web browser.
  • TXT files are universal — a file created on any device opens identically on any other device.
  • Many programs and websites use TXT files to store settings, instructions, or data that needs to stay readable for decades.

Why TXT files exist and why they still matter

TXT files were created in the earliest days of computing because computers needed a way to store text that would survive changes in software, hardware, and operating systems. A Word document created in 2005 might not open in 2025 — Microsoft changes the format, the software becomes obsolete, or the file gets corrupted. A TXT file from 1985 opens in 2025 exactly as it was written.

This simplicity is why TXT files are still everywhere. Your router's configuration file is a TXT file. Your website's instructions to search engines (the robots.txt file) is a TXT file. When you read a software program, the license agreement and the readme file are usually TXT files. They will still be readable in fifty years because there is nothing to break.

How to open and create a TXT file

Opening a TXT file is straightforward. Right-click the file, choose "Open with," and select any text editor. On Windows, Notepad is built in. On Mac, TextEdit is built in (though you may need to set it to plain text mode first). You can also open a TXT file in your web browser — just drag it into the browser window or use File > Open.

Creating a TXT file is even simpler. Open Notepad or TextEdit, type whatever you want, and save the file with a name that ends in ".txt". When you save, the program will ask you where to put it and what to name it. Type something like "notes.txt" or "shopping_list.txt" and click Save. That is all there is to it.

If you want to edit a TXT file later, open it the same way. Make your changes and save. Because TXT files have no formatting, there is nothing to lose — the file will look the same every time you open it.

TXT files versus Word documents and other formats

The main difference between a TXT file and a Word document (.docx) or a Google Doc is that TXT files have no formatting at all. A Word document can have different fonts, sizes, colors, bold text, tables, images, and page breaks. A TXT file cannot. If you paste formatted text into a TXT file, all the formatting disappears — you are left with just the words.

This is actually an advantage in many situations. If you need to share text that will look the same on every device, use TXT. If you need to store data that will be readable in 2075, use TXT. If you are writing code or configuration instructions, use TXT. If you need to create a resume with a specific layout or a newsletter with images, use Word or Google Docs instead.

Where you encounter TXT files without realizing it

You probably use TXT files more often than you think. When you read software, the "Read Me" file is usually a TXT file. When you change your password on a website, the recovery codes it gives you are often stored in a TXT file you read. When you export data from one program to move it to another, the export is often a TXT file (or a CSV file, which is a TXT file organized in columns).

Websites use a file called robots.txt to tell search engines which pages to index and which to skip. System administrators use TXT files to store configuration settings, logs, and instructions. Programmers use TXT files to write code (though they usually save it with a different extension like .py or .js to tell the computer what kind of code it is). In every case, the reason is the same: TXT files are straightforward, universal, and will work forever.

When to use TXT and when to use something else

Use a TXT file when you need text that will be readable on any device, when you do not need formatting, or when you want the file to survive software changes. Use TXT for notes, lists, instructions, configuration files, and any text you might need to read decades from now.

Use Word, Google Docs, or another formatted document when you need bold, italics, colors, images, or a specific page layout. Use a spreadsheet program like Excel or Google Sheets when you need to organize data in rows and columns. Use a PDF when you want to share a document that looks the same on every device but should not be edited. Each format has a purpose.

Frequently Asked Questions

Can I convert a Word document to a TXT file?

Yes. Open the Word document, go to File > Save As, and choose "Plain Text (.txt)" from the format dropdown. The document will save as a TXT file, but all formatting — bold, colors, images, tables — will be lost. Only the words remain.

Is a TXT file safe to open?

Yes. A TXT file contains only text, so it cannot carry viruses or malware. However, if someone sends you a TXT file claiming to be something else (like a photo or a program), be cautious. The file extension might be misleading, even though the file itself is harmless.

What is the difference between a TXT file and a CSV file?

A CSV file is a TXT file organized in a specific way: data separated by commas, with each row on a new line. You can open a CSV file in a text editor and see the commas, or open it in a spreadsheet program like Excel and see the data in columns. Both are plain text underneath.

Can I open a TXT file on my phone?

Yes. On iPhone, use the Files app or any text editor app from the App Store. On Android, use the Files app or any text editor app. You can also email yourself a TXT file and open it from your email app. Because TXT files are universal, they work on phones just as they do on computers.

Why would someone send me a TXT file instead of just typing the message?

Usually because the text is long, needs to be saved for later, or needs to be imported into another program. A TXT file is also useful when someone wants to send you data, instructions, or a list that you might want to edit or organize yourself.