.gz MIME Type: application/gzip

Files ending in .gz (Gzip archive) use the MIME type application/gzip.

Updated

application/gzip
MIME type for .gz
Archives
Category
No
Compress with gzip/Brotli

What is the MIME type of .gz files?

The MIME type (media type) for Gzip archive files with the .gz extension is application/gzip. You may also see application/x-gzip. A gzip file served as a download. Do not confuse it with Content-Encoding: gzip, which compresses a response transparently.

Content-Type header

Content-Type: application/gzip

Server configuration

ServerConfiguration
Nginx (mime.types or types {})application/gzip gz;
Apache (.htaccess)AddType application/gzip .gz
IIS (web.config)<mimeMap fileExtension=".gz" mimeType="application/gzip" />
Node.js / Expressres.type('gz') or res.setHeader('Content-Type', 'application/gzip')
Amazon S3Set Content-Type: application/gzip on the object (metadata), or pass --content-type application/gzip to aws s3 cp

Should .gz files be compressed?

No. Gzip archive files are already compressed internally, so gzip or Brotli would waste CPU and barely reduce — sometimes even increase — the size. Leave application/gzip 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.

MIME type lookupSearch every common file extension and MIME type, with copy-ready Content-Type headers.
Search all MIME types

Frequently asked questions

What is the MIME type for .gz?
application/gzip. Alternatives seen in the wild: application/x-gzip.
How do I set the Content-Type for .gz in Nginx?
Make sure application/gzip gz; is listed in the types block (usually in /etc/nginx/mime.types) and reload Nginx.
Should I gzip .gz files?
No — the format is already compressed, so HTTP compression gives no benefit.