devkult_
tools29converters34
home/mime/.xlsx

.xlsx MIME type

Excel workbookdocuments

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Modern Excel workbooks — a ZIP archive of XML files.

MIME typeapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Extensions.xlsx
Content-Typeapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Compress in transit?No — already compressed
File signature50 4B 03 04 (PK..)
the ZIP signature — this format is a ZIP archive inside

Good to know

  • When generating spreadsheets for download, CSV is simpler — but XLSX preserves types, formatting and multiple sheets.
  • Macro-enabled workbooks use .xlsm with application/vnd.ms-excel.sheet.macroEnabled.12.

Serve .xlsx files with the right type

The response header to send:

Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

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.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
Apache (.htaccess or server config)
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet .xlsx
Express
res.set("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
Python
import mimetypes

mimetypes.add_type("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", ".xlsx")
HTML file input
<input type="file" accept=".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">

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.xlsx | grep -i '^content-type:'
file --mime-type file.xlsx

Frequently asked questions

What is the MIME type for .xlsx files?

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.

What Content-Type header should a .xlsx file be served with?

Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet. It's already compressed, so servers shouldn't gzip it.

How can I tell if a file is really a .xlsx?

Check its bytes rather than the extension: XLSX files start with 50 4B 03 04 (PK..) — the ZIP signature — this format is a ZIP archive inside. On the command line, file --mime-type name.xlsx does this for you.

Related types

Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options