.TXT

TXT File

Plain Text File
Ask a question
QUICK ANSWER

A TXT file is plain, unformatted text - the simplest document format on any computer. Double-click it: Windows opens it in Notepad, macOS in TextEdit, Linux in gedit. Nothing to install. If characters look garbled, the file uses a different encoding than your editor assumed - reopen it and choose UTF-8.

Developer: N/A - universal format, predates any single vendor (teletype/ASCII era) Category: Text Files Open standard MIME: text/plain
OPENS ON Windows macOS Linux Android iOS
Related: .DOC · .ODT · .DOCX · .GDOC

On this page

19k+ extensions indexed
Last reviewed Aug 5, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the TXT file format?

Files with the .txt extension contain unformatted text. .txt files can be opened and edited using even the simplest text editors, available on most operating systems by default - including Notepad on Windows and TextEdit on macOS.

Unlike document formats used by advanced word processors such as .docx, .txt stores no formatting whatsoever. There are no fonts, colors, or paragraph styles embedded in the file; any visible layout (indentation, line breaks) relies solely on the characters themselves.

Unformatted text files are typically used to save short notes. .txt files are also commonly included with software installers - typically named README.txt - and contain information such as system requirements, main functions, and version numbers.

Because .txt carries no fixed character encoding, the same file may use UTF-8, Windows-1252, or other code pages. Related formats include .log for application output, .md for lightweight markup, and .csv for tabular data.

Security & safety

RISK: LOW

A .txt is plain text and cannot execute code, so opening one is safe. The only real cautions: (1) double extensions - malware is sometimes named "invoice.txt.exe"; with file extensions shown, the real type is .exe, not .txt, so check the true extension; (2) opening a huge log (gigabytes) in basic Notepad can hang - use Notepad++/VS Code or a viewer; (3) garbled text is an encoding mismatch, not corruption - reopen as UTF-8.

Format details

in a nutshell
FULL NAMEPlain Text File
DEVELOPERN/A - universal format, predates any single vendor (teletype/ASCII era)since Concept predates personal computers; .txt as the standard suffix since early MS-DOS/CP-M (late 1970s-1980s)
CATEGORYText Files
MIME TYPEtext/plain
TYPEplain text (unstructured, human-readable characters)
STANDARDOpen · royalty-free

Programs that open TXT files

Windows3 apps
Windows Notepad Built-in Double-click the file; it opens in Notepad. Modern Notepad handles Unix line endings and lets you pick the encoding (bottom-right status bar).
Notepad Open-source Open large files, logs and code; use Encoding menu to switch/convert UTF-8 ↔ ANSI and fix garbled characters.
Visual Studio Code Open-source Open the .txt; click the encoding in the status bar to 'Reopen with Encoding' if text is garbled.
macOS3 apps
TextEdit Built-in Double-click to open. Use Format → Make Plain Text to stay in .txt; choose encoding when opening if characters look wrong.
BBEdit Freemium Open large or code-like text files; free mode covers viewing/editing and encoding conversion.
Visual Studio Code Open-source Open the file; switch encoding from the status bar if needed.
Linux3 apps
gedit / GNOME Text Editor Open-source Double-click in Files, or 'gnome-text-editor file.txt'. Encoding is auto-detected with manual override.
KWrite / Kate Open-source Open the .txt in the KDE editor; Tools → Encoding to fix garbled characters.
nano / vim Open-source Terminal editing: 'nano file.txt' (simple) or 'vim file.txt' (powerful) - pre-installed on most distros.
Android1 app
Files by Google Free Tap the .txt to preview the text; for editing install a simple text editor app.
iOS1 app
Files / Notes Built-in Tap a .txt in the Files app to preview; share into Notes or Pages to edit.

Technical details

deep spec
MIME typetext/plain
Character encodingNo fixed encoding - common choices include UTF-8, UTF-16 LE/BE, Windows-1252, ISO-8859-1, and legacy code pages; encoding is inferred, not declared in the file
Byte-order mark (BOM)Optional leading bytes: UTF-8 BOM = EF BB BF, UTF-16 LE = FF FE, UTF-16 BE = FE FF; most .txt files carry no BOM, requiring heuristic detection
Magic bytes / file signatureNone - no fixed binary signature; content-type is identified by the .txt extension or heuristic encoding sniffers
Line endingsPlatform-dependent: CRLF (\r\n) on Windows, LF (\n) on Unix/Linux/macOS; mismatch between systems can cause display issues in some editors
Maximum file sizeNo format-imposed limit; bounded by the host file system (FAT32 caps at 4 GB; NTFS and ext4 support multi-terabyte files)
Character set supportFull Unicode (1,114,112 code points) in UTF-8 and UTF-16 variants; restricted to 128 characters in strict ASCII; legacy encodings cover specific regional scripts
StructureCompletely unstructured - paragraphs, lists, and sections exist only as blank lines and spaces; no semantic markup or hierarchy
Embedded metadataNone - the format stores no author, title, date, or language tag; such information exists only at the OS file-system level
CompressionNo built-in compression; textual redundancy makes .txt files highly compressible by gzip or DEFLATE (typically 60-80% size reduction)
Binary contentNot supported - the file must contain only valid character data; binary bytes cause encoding errors or display as replacement characters (U+FFFD)
Common file namesREADME.txt, LICENSE.txt, CHANGELOG.txt, TODO.txt, notes.txt - conventionally used in software distributions
InteroperabilityUniversally readable on every platform and by every text-capable application; no version lock-in or proprietary dependency
Encoding detection riskThe absence of a declared encoding means the same file can render differently in editors assuming UTF-8 vs. Windows-1252, causing garbled non-ASCII characters
Programmatic accessStandard I/O in every language: Python open(), Java FileReader, C fopen(), PowerShell Get-Content, shell redirection (> and >>)
ReleasedConcept predates personal computers; .txt as the standard suffix since early MS-DOS/CP-M (late 1970s-1980s)
Open standardYes · royalty-free
Specificationwww.unicode.org

TXT conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with TXT files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about TXT files.

Frequently asked questions

How do I open a TXT file?
Double-click it. Windows opens it in Notepad, macOS in TextEdit, Linux in gedit/KWrite. Any text editor works - there is nothing to install. For big files or code, use Notepad++ or VS Code.
Why is my TXT file showing weird characters (é, , squares)?
It's an encoding mismatch - the file is in a different encoding than your editor assumed. Reopen it and choose UTF-8 (in modern Notepad it's shown bottom-right; Notepad++/VS Code have an Encoding menu).
Why is my whole TXT file on one line?
It uses Unix line endings (LF) and you opened it in an old editor expecting Windows CR+LF. Modern Notepad, Notepad++ and VS Code display it correctly.
How do I convert a TXT file to PDF?
Open it and choose Print → Save as PDF (built into Windows, macOS and browsers), or paste it into Word/Google Docs and export to PDF. The text just gets a printable page layout.
How do I convert a TXT file to Word (DOCX)?
Open the .txt in Word, Google Docs or LibreOffice Writer and Save As .docx. You can then add formatting the plain text never had.
Is it safe to open a TXT file?
Yes - plain text can't run code. The only trick to watch for is a fake name like 'file.txt.exe'; with extensions visible you'll see it's really an .exe, which you should not run.
What's the difference between TXT and DOC/DOCX?
TXT is raw characters with no formatting; DOC/DOCX is a Word document that adds fonts, styles, images and layout. Saving a .txt as .docx wraps the same words in a formatted container.

References

1Unicode Standard (text encoding)www.unicode.org
2IANA - text/plain media typewww.iana.org

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.PARTPartial Download File
4.MDMarkdown Document
5.EXEWindows Executable (Portable Executable)
6.BINCD/DVD Disc Image (BIN/CUE)
7.JPGJPEG Image
8.NOMEDIAAndroid No-Media Marker File
9.DATProgram Data File (generic)
10.TMPTemporary File

Related extensions

.DOCMicrosoft Word 97-2003 Document
.ODTOpenDocument Text
.DOCXMicrosoft Word Open XML Document
.GDOCGoogle Docs Shortcut (Link to a Google Docs document)
.LSTList File (generic plain-text list / listing)
.VNTvNote (mobile phone text note / memo)

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z