Media type · application/gzip
application/gzip
The media type for gzip-compressed files (.gz), distinct from Content-Encoding: gzip.
Key facts
| Type | application/gzip |
|---|---|
| Registered | RFC 6713 |
| Extensions | .gz, .tgz |
| Magic bytes | 1f 8b |
| Content-Encoding | gzip (different meaning) |
| Charset | Not applicable |
Media type versus content coding
Content-Type: application/gzip says the body is a gzip file. Content-Encoding: gzip says the body is compressed for transport and must be decoded before interpretation; the underlying media type is whatever Content-Type says. Serving a .tar.gz download with Content-Encoding: gzip and Content-Type: application/x-tar makes browsers try to untar the decompressed bytes, which is rarely what you want.
Serving downloads
Use application/gzip with Content-Disposition: attachment for an archive. Do not let a proxy re-compress an already compressed file; it wastes CPU and can confuse clients. For streaming APIs, gzip is a transport encoding, not a file format.
Frequently asked questions
What is the difference between .gz and .tar.gz?
The media type describes gzip compression. The inner tar container is a separate format, usually indicated by the filename.
Can browsers display application/gzip?
No. They download or pass it to a helper application.
Should API responses use application/gzip?
No. Use Content-Encoding: gzip with the real media type of the payload.