TXT: Plain Text
The simplest file in the world.
Understand the universal standard of plaintext, ASCII concepts, and why programmers rely heavily on .txt files.
The Plain Text File.
A .txt file is the simplest way to save words on a computer. It has no colors, no fancy fonts, and no images. It only holds letters, numbers, and symbols. Because it is so simple, it is the most reliable file in the world.
Hello world. This is a .txt file. It is plain and simple. It will open on any computer.
The "Naked" File
Other files hide secret instructions. A text file is completely naked. What you see is exactly what is saved.
It saves the words, but it also saves thousands of hidden rules about how the words should look.
It strips away all the rules. It refuses to remember colors or sizes. It only remembers the letters.
The Four Superpowers
Why do experts still use a file format from the 1970s? Because it has four things no other file has.
1. It is Universal
Every phone, tablet, and computer can read it. You do not need to buy or download special software to open a text file. It just works, everywhere.
2. It is Tiny
Because it holds no extra styling data, it takes up almost no space on your hard drive. You can store millions of words in the space of one photograph.
3. It is Safe
A plain text file cannot run a program. It cannot hold a computer virus. Opening a .txt file is one of the safest things you can do on a computer.
4. It Lives Forever
Software companies go out of business. Old apps stop working. But a text file made 40 years ago will still open perfectly on a brand new computer today.
The Weight Test
Let's look at how much computer memory it takes to save the exact same sentence: "Hello World".
Includes fonts, margins, page size, author name, and history.
Exactly one byte for each letter and space. Nothing more.
Inside the Machine
Computers only understand numbers. When you save a .txt file, it simply matches every letter to a specific number. This map is called ASCII.
Real World Jobs
Who uses these files? Everyone who builds things on computers. Here is how they use them.
Used by writers to write down quick thoughts without worrying about formatting.
Used by system builders to tell a computer program how to turn on and run.
Used by computers to keep a diary of mistakes, so humans can fix them later.
The first file you should open. It gives you the rules for using a new software.
The Secret Relatives
Many files on your computer are just plain text files wearing a mask. If you change their name ending to .txt, you can read them!
Tools to Open Them
Every computer comes with a free tool to make and read text files. You do not need to buy anything.
Windows
Notepad
Mac
TextEdit
Linux
Nano / Vim
When to Say NO to .txt
Text files are great, but they are terrible at some jobs. Do not use them for these tasks:
-
Secret Passwords Text files cannot be locked or hidden easily. Anyone who finds the file can read it instantly.
-
Nice Documents If you need a bold title, bullet points, or pictures (like a resume), a text file will ruin your layout.
-
Math and Charts Text files cannot add numbers together or draw lines. Use a spreadsheet instead.
How to Name Them
Because text files are used by computer systems, you should name them carefully so the computer does not get confused.
Good Names
- notes.txt
- daily_log.txt
- server-config.txt
- 2026-04-26-data.txt
Rule: Use small letters. Use dashes or underscores instead of spaces.
Bad Names
- My Notes.txt
- FINAL LOG!!!.txt
- data copy (2).txt
- config?.txt
Rule: Do not use spaces. Do not use symbols like ? or ! or brackets.
The Time Machine
Digital things break fast. Text files do not. They outlive everything else on a computer.
The Birth of Plain Text
Early computers agree on a standard way to save text (ASCII). The first pure text files are born.
The Internet Boom
The web is built. Websites are just text files sent across telephone wires to other computers.
Still Running the World
A text file saved in 1975 still opens instantly on today's newest supercomputers without any errors.
How to Make One Right Now
You do not need to download anything. You can make a text file on your computer in three simple steps.
Right-Click
Go to your computer desktop. Use your mouse to right-click on any empty space.
Choose "New"
Look at the menu that pops up. Click on "New", and then select "Text Document".
Give it a Name
Type a simple name for your file, like hello.txt, and press the Enter key. You are done!
Changing Words Instantly
Because text files are so simple, computers can read them incredibly fast. This gives you a magic power called "Find and Replace."
Imagine you wrote a 500-page book in a text file, but you spelled the hero's name wrong on every single page.
In a text file, the computer can find and fix all 5,000 mistakes in less than one second. It never crashes because there is no hidden styling getting in the way.
How Much Can It Hold?
You might wonder if a text file will get "full" if you type too much. The answer is: practically never.
Words and beyond.
You can type one million words into a single .txt file, and the file will still be smaller than one single song on your phone.
When Text Looks Like Alien Math
Sometimes you open a text file from the internet, and instead of normal words, you see strange symbols like é or . Why does this happen?
The Language Mix-Up
Remember how computers turn letters into numbers? Different parts of the world used to use different number maps for their languages.
The UTF-8 Fix
Today, the whole world agrees to use one master map called UTF-8. If you save your text file as UTF-8, it will show up perfectly everywhere.
Every App Starts as Plain Text
Every video game, every phone app, and every website on the internet was built using plain text files.
if
player_jumps:move_up(10)
A Working Video Game
Programmers write instructions in simple text files. Then, a special tool reads that text and brings the game to life.
Finding a Needle in a Haystack
If you lose a piece of information, text files are the easiest place to find it.
Lightning Fast Search
If you have a folder with 1,000 text files, your computer can search through every single word in all 1,000 files in about one second. It can do this because it does not have to waste time looking past pictures or font styles.
Fast and Cheap to Print
Printers often get confused by complex files with strange margins and big pictures. Printers love plain text.
Saves Ink
Text files print using standard, unbolded letters. There are no thick graphics or colorful backgrounds to drain your ink cartridges.
Prints Instantly
A printer does not have to "think" about how to draw a text file. It just spits out the words immediately.
The Only Tiny Problem
Text files are almost perfect. But there is one tiny argument between Windows and Mac computers: how to press the "Enter" key.
Windows
When you press Enter to start a new line, Windows secretly saves two invisible commands: "Go back to the start" AND "Go down one line."
Mac & Linux
When you press Enter, Mac and Linux only save one invisible command: "Go down one line."
Don't worry! Modern text editors automatically fix this problem for you.
The Perfect Email Attachment
Have you ever tried to email a file, and the email failed because the file was too big? That never happens with text files.
You Can Send Thousands
An email system will let you attach about 25 Megabytes of data. You could attach roughly 10,000 long text files to a single email before the system would stop you. They are the ultimate lightweight message.
The Golden Rules
A quick summary of everything you have learned at getbetterat.work.
More in this series
Master more skills with other tutorials from the Markdown & Text series.
Data Engineering
- DB: Generic Database File: The universal data container.
- SQLite: Portable Database: A database in a single file.
- SQL: Structured Query Language: The language of data.
- CSV: Comma-Separated Values: The universal data exchange format.
Spreadsheets
- NUMBERS: Apple Numbers Spreadsheet: Visual data storytelling.
- XLSM: Macro-Enabled Spreadsheet: Excel with automation power.
- ODS: OpenDocument Spreadsheet: The open spreadsheet standard.
- XLS: Legacy Excel Spreadsheet: The foundation of digital spreadsheets.
- XLSX: Modern Excel Spreadsheet: The data powerhouse.
Presentations
- ODP: OpenDocument Presentation: The open standard for slides.
- PPT: Legacy Presentation: The classic slide deck format.
- PPTX: Modern Presentation: The gold standard for slide decks.
Word Processing
- WPS: WPS Office Document: The lightweight contender.
- PAGES: Apple Pages Document: The designer's word processor.
- ODT: OpenDocument Text: The open text standard.
- DOC: Legacy Word Document: The classic document format.
- DOCX: Modern Word Document: The standard for office documents.
- RTF: Rich Text Format: The universal translator.
Digital Publishing
- TEX: LaTeX Document: The mathematician's choice.
- PDF: Portable Document Format: The digital paper standard.
Software Engineering
- TSX: TypeScript XML: The modern web component.
Markdown & Text
- MD: Markdown: The programmer's writer.
- TXT: Plain Text: The simplest file in the world.