# .xls MIME Type: application/vnd.ms-excel

> Legacy binary Excel workbooks.

- MIME type: `application/vnd.ms-excel`
- Extensions: .xls
- Content-Type header: `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 `.csv` uploads when Excel is installed.

## Server configuration

### 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">
```

## FAQ

### 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

- [.xlsx — application/vnd.openxmlformats-officedocument.spreadsheetml.sheet](https://www.devkult.com/mime/xlsx.md)
- [.csv — text/csv](https://www.devkult.com/mime/csv.md)

Open the interactive page: https://www.devkult.com/mime/xls