What Is a .TXT File?
A .txt file is a plain text file: just characters, with no fonts, bold, images or layout. It is the simplest and most portable document format, readable by every operating system and text editor, and used for notes, logs, README files, configuration and data that needs to stay readable for decades.
- Extension
- .txt
- Full name
- Plain Text File
- Type
- Document file
- MIME type
- text/plain
About TXT files
A text file is only a sequence of characters in some encoding. Today that is almost always UTF-8, which covers every language and emoji, but older files may be ANSI (Windows-1252) or another legacy code page. Opening a file in the wrong encoding produces garbled characters such as é instead of é; most editors let you reopen with a different encoding.
Line endings differ between systems: Windows uses CRLF, while macOS and Linux use LF. Modern Notepad, TextEdit and code editors handle both, but some older tools and scripts care. Text files are tiny, typically a few kilobytes, and compress extremely well.
Plain text cannot contain macros or embedded objects, so a genuine .txt is about as safe as a file gets. Watch for double extensions, though: a file named notes.txt.exe or invoice.txt.js is a program pretending to be text, which is why showing file extensions in Windows is worthwhile.
What TXT files are used for
- Quick notes, lists and drafts
- Log files and program output
- README and license files
- Configuration and data files read by software
How to open a .txt file
Windows
Double-click to open in Notepad. VS Code and Notepad++ are good for large files or code.
Mac
TextEdit opens .txt files; Quick Look previews them with Space, and VS Code works for large files.
iPhone and iPad
Tap the file in the Files app to preview it.
Android
Files by Google previews text files; any text editor app can edit them.
Online / any browser
Drag the file into a browser tab to read it, or upload it to Google Drive and open it with Google Docs.
How to convert a .txt file
To turn text into a formatted document, open it in Word, Pages or Google Docs and save as .docx or PDF. To print to PDF, use Print and choose Microsoft Print to PDF on Windows or the PDF button on a Mac.
Renaming .txt to .csv or .md is fine when the text already follows that format, because they are all plain text; renaming it to .docx or .pdf does not convert it.
To fix encoding problems, open the file in Notepad or VS Code and save it again with UTF-8 encoding.
Convert it here, free and without uploading: TXT to PDF
Changing the extension in the file name does not convert the file. See how to change a file extension for when renaming is safe.
Naming and renaming TXT files
- Use a date prefix for notes and logs, for example 2026-03-14_meeting-notes.txt, so they sort chronologically.
- Turn on "File name extensions" in Windows File Explorer to spot disguised files like readme.txt.exe.
- Use names like README.txt or LICENSE.txt in uppercase when bundling with software; it is a widely recognised convention that makes them easy to find.
Renaming lots of .txt files? See how to rename txt files with ai, use the free online bulk renamer for patterns and numbering, or try File Renamer AI to name each file from what is inside it.
Related file types
A .md file is a Markdown document: plain text with lightweight formatting marks such as # for headings, **bold**, - for bullet lists and [text](url) for links. It reads naturally as text and converts cleanly to HTML, which is why Markdown is the standard file extension for README files, documentation and notes apps.
A .rtf file is a Rich Text Format document: text with basic formatting such as fonts, sizes, bold, italics, colours, tables and images, written as readable control codes inside a plain-text file. Created by Microsoft in 1987, it remains a lowest-common-denominator format that almost every word processor can open.
A .csv file is a plain-text table where each line is a row and commas separate the columns. It has no formatting, formulas or multiple sheets, which makes it the universal format for moving data between spreadsheets, databases, banking portals, CRMs and code. Any text editor or spreadsheet app can open it.
A .docx file is a Microsoft Word document saved in the Office Open XML format used by Word 2007 and later. It stores text, formatting, images, tables, comments and tracked changes in a compressed ZIP package, and it is the default format for editable documents in Word, Google Docs exports and most office suites.
Frequently Asked Questions
Why does my text file show strange characters?
It was saved in a different encoding than the one your editor assumed. Reopen it with UTF-8 or the correct legacy encoding, then save it as UTF-8.
Can a .txt file contain a virus?
A real text file cannot run code. Be careful with names like file.txt.exe, which are executables disguised as text.
What is the difference between .txt and .rtf?
.txt holds only characters, while .rtf adds formatting such as fonts, bold and colours using text-based codes.