A text file is a computer file represented as a sequence of characters. The end of a text file is often denoted by placing one or more special characters, known as an end-of-file marker, after the last line in a text file.

Data storageEdit

Because of their simplicity, text files are commonly used for storage of information. They avoid some of the problems encountered with other file formats, such as endianness, padding bytes, or differences in the number of bytes in a machine word. Further, when data corruption occurs in a text file, it is often easier to recover and continue processing the remaining contents. A disadvantage of text files is that they usually have a low entropy, meaning that the information occupies more storage than is strictly necessary.


Each character is usually represented to and from bytes using an encoding. Common encodings are ASCII, which uses 8-bits (256 total characters) and Unicode (different Unicode encodings have different sizes). Characters are usually separated into lines, using a newline character. This character varies in platforms, for example, Windows uses a line feed / carriage return combination, while Unix-like systems uses only the line feed character.

See alsoEdit

This page uses CC-BY-SA content from Wikipedia (authors). Smallwikipedialogo.png