OfficePad

Formats/TXT

What Is a TXT File? Plain Text Explained

A TXT file, with the .txt extension, is plain text and nothing else: the raw characters you typed, with no fonts, no bold, no colours, no images, no layout. It is the most basic and most universal document format in existence, readable by every operating system and text editor ever made, and it has changed so little in decades that a TXT file from the 1980s opens perfectly today. That radical simplicity is both its limitation and its greatest strength.

What "plain text" really means

A plain-text file stores only characters — letters, digits, punctuation, spaces and line breaks — with no instructions about how they should look. There is no concept of a bold word or a heading; a heading in a TXT file is just a line of text that a human recognises as a heading, not something the file marks as special. When you see a TXT open in a monospaced font, that font comes from the editor showing it, not from the file, which carries no styling at all.

This is the opposite of a word processor document, which wraps your words in a mountain of formatting data. A TXT is just the words. That is why the same file is a few kilobytes where a formatted document of the same text might be many times larger.

Why plain text refuses to die

TXT endures because it is universal, tiny and future-proof. Every device on earth can open it, it takes almost no space, and because there is no proprietary format to become obsolete, it will still be readable long after today's software is gone. It is also ideal for anything a program needs to read: configuration files, logs, code, data dumps and notes are overwhelmingly plain text precisely because it is unambiguous and easy for software to parse.

For quick notes, jotting, and content you want to keep for the very long term with zero dependencies, plain text is hard to beat. When you do want light formatting without giving up plain text's portability, Markdown adds simple structure using ordinary symbols while keeping the file readable as plain text.

The one quirk: encoding and line endings

Plain text is simple but not entirely free of gotchas. The first is character encoding: the file has to record which byte values map to which characters, and if a program guesses the wrong encoding, accented letters, emoji or non-Latin scripts can turn into garbled symbols. Saving as UTF-8 — now the near-universal standard — avoids almost all of this and handles every language and emoji.

The second is line endings: Windows historically marks the end of a line differently from macOS and Linux, which is why a TXT written on one system occasionally shows up with no line breaks, or with odd characters, on another. Most modern editors handle both transparently, but it explains the rare case of a text file that looks like one giant run-on line.

How to open and work with a TXT

Every computer and phone opens TXT with a built-in editor — Notepad on Windows, TextEdit on macOS — and every code editor handles it too. Because it is just characters, plain text is easy to transform: you can change its case, count its words, or compare two versions line by line to see exactly what changed. If you want to add light formatting while keeping the file portable, writing in Markdown is the natural next step. OfficePad's text tools run entirely in your browser.

Frequently asked questions

What is the difference between TXT and a Word document?

A TXT file stores only plain characters with no formatting, fonts or images. A Word document wraps the text in formatting data, so it can hold styling and layout that plain text cannot.

Why does my text file show garbled characters?

Almost always a character-encoding mismatch — the program opened it assuming the wrong encoding. Saving and opening as UTF-8, the modern standard, fixes this for virtually every language and emoji.

How do I add formatting to plain text?

Use Markdown, which adds headings, bold, lists and links using ordinary symbols while keeping the file readable as plain text and portable everywhere.

Work with TXT on OfficePad

See also in the glossary: Character encoding, UTF-8, Metadata.