.xls MIME type
Excel 97–2003 workbookdocuments
application/vnd.ms-excelLegacy binary Excel workbooks.
| MIME type | application/vnd.ms-excel |
|---|---|
| Extensions | .xls |
| Content-Type | application/vnd.ms-excel |
| Compress in transit? | No — already compressed |
| File signature | D0 CF 11 E0 A1 B1 1A E1 the OLE2 compound-file signature shared by legacy Office formats |
Good to know
- Windows browsers may also report this type for
.csvuploads when Excel is installed.
Serve .xls files with the right type
The response header to send:
Content-Type: application/vnd.ms-excel
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/vnd.ms-excel xls;
Apache (.htaccess or server config)
AddType application/vnd.ms-excel .xls
Express
res.set("Content-Type", "application/vnd.ms-excel");Python
import mimetypes
mimetypes.add_type("application/vnd.ms-excel", ".xls")HTML file input
<input type="file" accept=".xls,application/vnd.ms-excel">
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.xls | grep -i '^content-type:' file --mime-type file.xls
Frequently asked questions
What is the MIME type for .xls files?
application/vnd.ms-excel.
What Content-Type header should a .xls file be served with?
Content-Type: application/vnd.ms-excel. It's already compressed, so servers shouldn't gzip it.
How can I tell if a file is really a .xls?
Check its bytes rather than the extension: XLS files start with D0 CF 11 E0 A1 B1 1A E1 — the OLE2 compound-file signature shared by legacy Office formats. On the command line, file --mime-type name.xls does this for you.
Related types
Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options