TXT (Plain Text)
The oldest and most universal file format on the internet: just characters, nothing hidden, readable by everything.
| Full name | Plain Text |
| Extension | .txt |
| MIME type | text/plain |
| Developer | No single author; roots in ASCII, standardized by ANSI/ISO and the IETF |
| Released | 1963 (ASCII standard); .txt extension in wide use by the early 1970s |
| Type | Plain text document |
| Encoding | ASCII, UTF-8, UTF-16, or system locale (UTF-8 most common today) |
| Line endings | LF on Unix/macOS; CR+LF on Windows; CR on legacy Mac OS |
What is a TXT file?
A .txt file stores text as a sequence of characters with no formatting, fonts, or embedded objects. Any program that can read characters can open one, from a terminal to a browser to a smartphone notes app. That simplicity is why the format has survived unchanged in concept since the earliest days of computing.
A plain text file contains only printable characters and a small set of control characters such as newline and tab. There are no headers, no binary structures, and no proprietary encoding beyond the character set itself. The content you see is the content that is stored: one character maps to one or more bytes depending on the encoding. Because there is nothing to interpret beyond the characters, the format never becomes unreadable as software changes.
History
Plain text is rooted in the ASCII character encoding standard, first published by the American Standards Association in 1963 after work that began in 1960. The IETF codified ASCII as the format for network data interchange in RFC 20, published by Vint Cerf in October 1969. The .txt extension became the standard label for plain text files on personal computers during the early 1970s and was cemented on DOS and Windows systems, where it remains the default extension for Notepad and most command-line output today.
How it works
A .txt file is a flat sequence of bytes with no internal structure beyond line breaks. Each character is encoded as one byte in ASCII or legacy encodings, or as one to four bytes in UTF-8. Lines are separated by a newline character (LF, byte 0x0A) on Unix systems, or by a carriage-return plus line-feed pair (CR+LF, bytes 0x0D 0x0A) on Windows. Some files begin with a byte-order mark (BOM) to signal UTF-8 or UTF-16 encoding, though the BOM is optional and can cause problems in tools that do not expect it.
What it is used for
- Storing configuration files, scripts, and log output that other programs read automatically
- Writing README files, changelogs, and documentation alongside source code
- Exchanging data between different operating systems and programming languages without compatibility problems
- Keeping notes, to-do lists, or journal entries that need to open on any device forever
How to open it
Every major operating system can open .txt files without installing anything: Notepad on Windows, TextEdit on macOS, and gedit or nano on Linux all work out of the box. Any web browser, code editor, or terminal emulator can also display the contents directly.
Pros and cons
Strengths
- Opens on every operating system, device, and programming language without special software
- Tiny file size because there is no formatting overhead or metadata
- Future-proof: a file written in 1970 is still readable today and will be readable in 50 years
- Easy to search, diff, and process with standard command-line tools like grep, awk, and sed
Trade-offs
- No support for formatting: no bold, italic, headings, tables, or images
- No standard way to specify font, size, or color, so visual presentation is left entirely to the viewer
- Line-ending differences between Windows and Unix systems can cause display problems in some tools
- Character encoding mismatches (ASCII vs UTF-8 vs Windows-1252) can corrupt non-Latin characters
Convert TXT files
Free, in your browser, no signup. Start at the TXT converter, or jump straight to a popular conversion below.
Curious how fast and how small? See our measured conversion benchmarks.
TXT FAQ
What is the difference between a .txt file and a .doc or .docx file?
A .txt file contains only the characters you typed. A .doc or .docx file wraps the same text in a binary or XML container that also stores fonts, paragraph styles, images, and revision history. That extra data means .docx files are larger and require Word or a compatible app to open correctly, while .txt files open anywhere.
Why do some .txt files look garbled when I open them?
The file was saved in one character encoding (for example Windows-1252 or Latin-1) but your text editor is reading it as UTF-8, or the other way around. Opening the file and choosing the correct encoding from your editor's settings fixes the display. UTF-8 is the best encoding to use for new files because it covers every language.
Can a .txt file contain malware?
A pure plain text file cannot execute code by itself, so simply opening one in a text editor is safe. The risk comes when a program that processes the file (like a log viewer or a script) mishandles the content. Renaming a malicious script to .txt does not make it safe if you then run it.
What is the maximum size of a .txt file?
The TXT format itself has no size limit. The practical ceiling is your file system: on modern NTFS, ext4, or APFS volumes that is several terabytes. Some text editors load the whole file into memory, so very large files (several gigabytes) may open slowly or need a streaming tool like less or a dedicated log viewer.