text/plain
The MIME type for unformatted text, and the default a server falls back to for any text-like file it cannot name more precisely.
text/plain is correct for a .txt file and accurate but unhelpful for everything else that uses it: source code in a dozen languages, build files, shell scripts, configuration formats. Browsers display all of them as raw text, which is harmless, and tools that key off the MIME type lose the distinction between a Python script and a grocery list.
Our catalogue has 26 formats under this type. Because none of them has a signature, telling them apart means looking at the structure, which is what a content-based detector does and a MIME label cannot.
Formats with this MIME type
- AIDL · Android Interface Definition Language ·
.aidl - AUTOHOTKEY · AutoHotKey script ·
.ahk - AUTOIT · AutoIt script ·
.au3 - BAZEL · Bazel build file ·
.bazel, .bzl - DM · Dream Maker ·
.dm - DOCKERFILE · Dockerfile ·
Dockerfile - GITATTRIBUTES · Gitattributes file ·
.gitattributes - GITMODULES · Gitmodules file ·
.gitmodules - HCL · HashiCorp configuration language ·
.hcl - HTACCESS · Apache access configuration ·
.htaccess - IGNOREFILE · Ignorefile ·
.gitignore, .dockerignore - INI · INI configuration file ·
.ini - INTERNETSHORTCUT · MS Windows Internet shortcut ·
.urlText beginning [InternetShortcut]. - NPMIGNORE · npm ignore file ·
.npmignore - PROTOBUF · Protocol buffer ·
.protoNo signature; a protobuf message starts directly with a field tag. - SMALI · Smali source ·
.smali - SRT · SubRip Text Format ·
.srtText beginning with the cue number 1 and a timing line. - STLTEXT · Stereolithography CAD (text) ·
.stlText beginning with the word solid. - SUM · Checksum file ·
.sum - TEXTPROTO · Text protocol buffer ·
.textproto - TOML · Tom's obvious, minimal language ·
.toml - TXT · Generic text document ·
.txt - WINREGISTRY · Windows Registry text ·
.regSignature72 65 67 66(regf) · details - YARA · YARA rule ·
.yar, .yara - M4 · GNU Macro ·
.m4 - PROTO · Protocol buffer definition ·
.proto
Where the MIME type comes from, and why it can be wrong
A MIME type is a label attached by whoever sends the file: a web server picks it from the file extension, an email client from the attachment name, an upload form from whatever the browser guessed. None of them read the content. A renamed file, a misconfigured server, or a deliberate disguise all produce a confident, wrong label.
To see what a server actually sends, and then what the file actually is:
# The declared type, from the HTTP headers
curl -sI https://example.com/file.aidl | grep -i content-type
# The real type, from the bytes (macOS and Linux)
file --mime-type file.aidlOr drop the file on our detector, which reports the type the bytes support and the MIME type that goes with it, without uploading anything.
Setting it correctly on a server
# Nginx (mime.types or a location block)
types { text/plain aidl ahk au3 bazel bzl dm Dockerfile gitattributes gitmodules hcl htaccess gitignore dockerignore ini url npmignore proto smali srt stl sum textproto toml txt reg yar yara m4 proto; }
# Apache (.htaccess)
AddType text/plain .aidl .ahk .au3 .bazel .bzl .dm Dockerfile .gitattributes .gitmodules .hcl .htaccess .gitignore .dockerignore .ini .url .npmignore .proto .smali .srt .stl .sum .textproto .toml .txt .reg .yar .yara .m4 .proto
# Any HTTP response
Content-Type: text/plain