What is the MIME type of .odt files?
The MIME type (media type) for OpenDocument text files with the .odt extension is application/vnd.oasis.opendocument.text. LibreOffice Writer format, ZIP-based.
Content-Type header
Content-Type: application/vnd.oasis.opendocument.text
Server configuration
| Server | Configuration |
|---|---|
Nginx (mime.types or types {}) | application/vnd.oasis.opendocument.text odt; |
Apache (.htaccess) | AddType application/vnd.oasis.opendocument.text .odt |
IIS (web.config) | <mimeMap fileExtension=".odt" mimeType="application/vnd.oasis.opendocument.text" /> |
| Node.js / Express | res.type('odt') or res.setHeader('Content-Type', 'application/vnd.oasis.opendocument.text') |
| Amazon S3 | Set Content-Type: application/vnd.oasis.opendocument.text on the object (metadata), or pass --content-type application/vnd.oasis.opendocument.text to aws s3 cp |
Should .odt files be compressed?
No. OpenDocument text files are already compressed internally, so gzip or Brotli would waste CPU and barely reduce — sometimes even increase — the size. Leave application/vnd.oasis.opendocument.text out of your compression configuration.
Why the MIME type matters
Browsers decide what to do with a response — render, run, play or download — from the Content-Type header, not the file extension. With X-Content-Type-Options: nosniff, a wrong type causes stylesheets and scripts to be blocked outright. For uploads, never trust the type sent by the client; check the file’s content (its magic bytes) on the server.
Frequently asked questions
What is the MIME type for .odt?
application/vnd.oasis.opendocument.text.How do I set the Content-Type for .odt in Nginx?
application/vnd.oasis.opendocument.text odt; is listed in the types block (usually in /etc/nginx/mime.types) and reload Nginx.