.rtf MIME type
Rich Text Formatdocuments
application/rtfFormatted text readable by nearly every word processor.
| MIME type | application/rtf |
|---|---|
| Extensions | .rtf |
| Also seen as | text/rtf |
| Content-Type | application/rtf |
| Compress in transit? | Yes — enable gzip or Brotli |
| File signature | 7B 5C 72 74 66 ({\rtf) |
Good to know
- RTF is plain text with control words, so it compresses well.
Serve .rtf files with the right type
The response header to send:
Content-Type: application/rtf
Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:
nginx (inside the types block in mime.types)
application/rtf rtf;
Apache (.htaccess or server config)
AddType application/rtf .rtf
Express
res.set("Content-Type", "application/rtf");Python
import mimetypes
mimetypes.add_type("application/rtf", ".rtf")HTML file input
<input type="file" accept=".rtf,application/rtf">
Check it
See what a server sends for a file, and what type a local file really is by its contents:
curl -sI https://example.com/file.rtf | grep -i '^content-type:' file --mime-type file.rtf
Frequently asked questions
What is the MIME type for .rtf files?
application/rtf. You may also see text/rtf, but application/rtf is the one to send.
What Content-Type header should a .rtf file be served with?
Content-Type: application/rtf. It compresses well, so let the server apply gzip or Brotli.
How can I tell if a file is really a .rtf?
Check its bytes rather than the extension: RTF files start with 7B 5C 72 74 66 ({\rtf). On the command line, file --mime-type name.rtf does this for you.
Related types
Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options