A text file is a computer file. 
A text file is a computer file. 
A text file is a type of computer file. It holds words in a sequence of lines. 
Most text files do not have special styles. They do not use bold or slanted words. This is called plain text.
Computers use encoding to read text. Encoding is a way to turn digital bits into letters. ASCII is a common way to write English text. Unicode is a much larger set. It can represent almost all known languages. UTF-8 is a very common way to use Unicode. It works well with the older ASCII style.
Different systems handle text in different ways. Windows often uses a .txt suffix for these files. Other files use different endings to show their purpose. For example, computer code is often kept in text files. Some systems use a marker to show the end of a file. This is called an end-of-file marker. Modern systems do not need this. They can track the file size themselves.
A text file is a special kind of computer file. It holds information as a sequence of lines of electronic text. 
How a text file works depends on the computer system. Some systems, like CP/M, use a special marker to show the end of a file. This is called an end-of-file or EOF marker. Modern systems like Windows and Unix-like systems do not need this. They simply keep track of the file size in bytes. Other systems, such as OpenVMS, use record-oriented filesystems. These store text as a sequence of fixed-length or variable-length records. Most systems use a symbol to show where a new line starts. In Windows, this is a carriage return and a line feed.
History shows us how these files have changed over time. In the old classic Mac OS, a file was a text file if it had a specific label. These older files used a single character to end each line. IBM also helped shape how we see text through OEM encodings. These were used for the original IBM PC text mode displays. They included special characters for drawing lines and shapes. Today, most computers have moved toward more universal ways of reading text. This helps different machines talk to each other more easily.
There are many important facts about how text is written. Computers use encoding to turn digital data into letters. ASCII is a very common set of characters for English. Unicode is a much larger set that covers almost all human languages. UTF-8 is the most common way to use Unicode today. It is special because it works perfectly with the older ASCII style.
You can see text files in many things you use every day. When you use a simple text editor, you are looking at plain text. This means there is no bold or slanted text to see. Some people use lightweight markup languages like markdown or wikitext. These are like an extension of plain text files. They add small notes that a computer can read. Even things like CSV files are a type of text file. They help organize data into simple rows and columns.
A text file is a specific type of computer file. It is structured as a sequence of lines of electronic text. 
How a text file is stored depends on the operating system being used. In older systems like CP/M, the computer does not track file size in bytes. Instead, it uses an end-of-file (EOF) marker. This is a special character placed as padding after the last line. Modern systems like Microsoft Windows, DOS, and Unix-like systems do not use EOF characters. They simply keep track of the exact file size in bytes. Some systems, such as OpenVMS or OS/360, use record-oriented filesystems. These store text as a sequence of fixed-length records or variable-length records. In these cases, a record-length value is kept in a record header.
Different operating systems also use different rules for starting new lines. Most systems use an end-of-line delimiter to separate text. DOS and Microsoft Windows use a two-character combination. This combination consists of a carriage return (CR) and a line feed (LF). In Unix-like systems, the standard is a single newline character known as LF. The classic Mac OS used a different method, terminating lines with only a CR character. macOS now follows the Unix format. However, macOS still recognizes older files using specific Uniform Type Identifiers (UTI). These identifiers include "public.plain-text" and "com.apple.traditional-mac-plain-text" for older files.
Encoding is the process of turning digital data into readable characters. The ASCII character set is a very common subset used for English-language files. It covers American English but lacks symbols like the euro sign or the British pound sign. To include these, a richer character set is required. Before the modern era, systems used single-byte encodings like ISO-8859 for European languages. Asian languages often required wide character encodings. Unicode was created to solve this by providing a standard for all known languages.
Microsoft Windows uses several different encoding methods for its text files. Many files use ANSI, which refers to single-byte ISO/IEC 8859 encodings. In some regions, like China or Japan, Windows uses double-byte character sets. Another method is OEM encoding, also called DOS code pages. These were defined by IBM for the original IBM PC text mode displays. They often include special characters for drawing lines and shapes. Windows also supports Unicode-encoded files using UTF-16. These files often begin with a byte order mark (BOM). This mark helps the computer understand the endianness, or the order of bytes, in the file.
File names often include a suffix to tell the computer what is inside. On Windows, a text file usually ends with the .txt extension. However, many other suffixes are used for specific purposes. For example, computer programmers keep their source code in text files. These files use suffixes that indicate the specific programming language used. Even though these files contain code, they are still considered text files. A text file can even be empty. This is known as a zero-byte file. 
Text files can be expanded using lightweight markup languages. Examples include TeX, markdown, and wikitext. These are still considered extensions of plain text because they remain human-readable. They contain small annotations that a computer can interpret. Early versions of HTML also functioned this way, though modern HTML is mostly unreadable by humans. Other formats like CSV, which stands for comma-separated values, are also related.
🖼️ Images & Media (2)
More to explore
✨ What else?
Related topics you might enjoy
🪜 Step back
Simpler topics to build understanding
What is Nepedia?
A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.