Plain text
Adapted from Wikipedia · Discoverer experience
In computing, plain text is a simple way to store information. It means data that shows only readable characters, like letters and numbers, without any special formatting or pictures. This is different from files that have styles, structures, or binary data, which include things like images or complex numbers.
Plain text can include spaces, line breaks, and tabs to arrange the text, but it does not include details about fonts, layouts, or special characters like curly quotes. People sometimes use the term loosely to describe files that have only straightforward, readable content.
Plain text can be stored in many different ways of encoding characters, but it is often linked to ASCII. As newer ways like Unicode-based encodings such as UTF-8 and UTF-16 become more common, this idea is changing.
A file is considered plain text if all its parts can be read as characters. If a file includes data that cannot be interpreted as text, like a binary integer, it is not plain text. Changing the encoding of a plain text file does not change its meaning, but changing a binary file can alter how the non-text data is understood.
Plain text and rich text
Plain text is just a simple row of letters and numbers, without any extra designs or pictures. It’s like writing with a pencil on paper — only the words show up.
Rich text, however, adds extra details like colors, bigger letters, or links. Even though it looks fancier, rich text is often stored as plain text with special codes mixed in. Examples include HTML, XML, and TeX. These codes tell a computer how to display the text nicely.
Using plain text helps files stay safe and usable over time, even on different kinds of computers. For example, saving files as UTF-8 text avoids problems that can happen when computers read numbers differently.
Usage
Plain text is used because it works on many different computers and programs without needing special rules. You can open, read, and change plain text files using simple tools called text editors.
People type commands in plain text when using a command-line interface and get answers back in plain text, too. Many programs, like those on DOS, Windows, classic Mac OS, and Unix, can work with plain text. Some web browsers, such as Lynx and the Line Mode Browser, also show plain text.
Programmers often write their code in plain text files. Settings for programs are also saved in plain text files. Plain text is widely used for e-mail and for comments or simple text files meant for people to read.
Keeping information in plain text is a good way to store it safely, instead of using more complicated formats.
Encoding
Character encodings
Main article: Character encoding
Before the 1960s, computers were mostly used for calculations and had very little memory. They often could only store 64 different characters because they used 6 bits for each character. This wasn’t enough for all the letters we use today, so many early computers didn’t even support lower-case letters.
Later, computer experts suggested using 8 bits for each character, which allowed for 256 different characters. This made it possible to include all the letters, numbers, and common symbols. Most computers began using a system called ASCII, which used numbers 0 to 31 for special commands and numbers 32 to 127 for regular letters and symbols. However, ASCII couldn’t include special letters used in many languages, like accents in French or Spanish.
To solve this, different countries created their own ways to add extra characters. This caused problems because a text might look wrong when shown on a different computer. Organizations like ISO created standards to help fix this. Today, we use Unicode Consortium’s Unicode, which can handle almost every written language in the world.
Control codes
Main article: C0 and C1 control codes
Main article: Unicode control characters
ASCII sets aside the first 32 numbers for special commands that tell computers how to handle the text, like moving to a new line or adding a tab. These are called control characters. Later systems added more control characters to handle writing directions and special symbols.
Related articles
This article is a child-friendly adaptation of the Wikipedia article on Plain text, available under CC BY-SA 4.0.
Images from Wikimedia Commons. Tap any image to view credits and license.
Safekipedia