Overview

A text file is a computer file that stores human-readable characters in sequence, typically organized into lines. It contains plain text rather than application-specific formatting or embedded binary objects. Plain text files are widely used for short notes, program source code, configuration settings and logs because they are simple, portable and easy to inspect with basic software. For a concise definition see primary reference.

Key characteristics

Text files have several practical properties that distinguish them from other file types:

  • Encoding: Contents are encoded with a character encoding such as ASCII or Unicode (UTF-8), which maps characters to numeric values.
  • Line structure: Data is arranged as a sequence of lines separated by newline characters (different systems use different conventions).
  • Human-readable: Most content can be read and edited with simple editors; examples include Notepad and other text editors.
  • Minimal metadata: Plain text lacks the formatting instructions, styles, or embedded media that appear in word-processor or binary files.

History and development

Early computing relied heavily on plain text because early storage and display systems were limited to characters. As personal computing evolved, text files remained fundamental: configuration files, scripts and source code stayed in plain text to maintain portability. Over time, character encodings expanded beyond 7-bit ASCII to accommodate international scripts, and conventions grew around newline handling and byte-order marks.

Common formats and extensions

Typical extensions for plain text include .txt, .csv (comma-separated values) and .md (markdown). Some extensions that users may associate with documents—such as .doc—usually denote files created by word processors; these files include formatting information and are not strictly plain text. The difference between plain text and binary files is important: a binary file contains encoded data not intended for direct human reading; see binary data and general data concepts. For a comparison with formatted documents, consult resources on word processing.

Uses and examples

Text files serve many everyday purposes: writing notes, drafting code, storing configuration, logging program activity, and exchanging tabular data in CSV form. Their simplicity makes them suitable for automation and version control. System administrators and programmers commonly prefer plain text for files that must be diffed, merged or processed by scripts.

Viewing, editing and interoperability

Because plain text is widely supported, nearly every operating system includes tools to view or edit it. On Windows, simple programs like Notepad open text files, while development environments and dedicated editors provide rich features for programmers. When exchanging files between platforms, attention to character encoding and newline conventions helps avoid corruption. Learning the distinctions between plain text (plain text) and other formats is useful when deciding how to store or share information.