.gif MIME Type: image/gif

Files ending in .gif (GIF image) use the MIME type image/gif.

Updated

image/gif
MIME type for .gif
Images
Category
No
Compress with gzip/Brotli

What is the MIME type of .gif files?

The MIME type (media type) for GIF image files with the .gif extension is image/gif. Supports animation with up to 256 colors. For animations, MP4 or animated WebP are usually 5–10× smaller.

Content-Type header

Content-Type: image/gif

Server configuration

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

Should .gif files be compressed?

No. GIF image files are already compressed internally, so gzip or Brotli would waste CPU and barely reduce — sometimes even increase — the size. Leave image/gif 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 .gif?
image/gif.
How do I set the Content-Type for .gif in Nginx?
Make sure image/gif gif; is listed in the types block (usually in /etc/nginx/mime.types) and reload Nginx.
Should I gzip .gif files?
No — the format is already compressed, so HTTP compression gives no benefit.