A text file is a type of computer file structured as a sequence of lines of electronic text contained within a computer file system. Text files can contain plain text content but are not limited to only plain text. There are two main types of computer files: text files and binary files, with text files structured as lines of electronic text and binary files using binary numbers.