About TIFF image files
Common in scanning, printing and photography, and used for multi-page scanned documents. Only Safari can display TIFF, so convert it to PNG, JPEG or PDF before showing it on a web page.
File signature
TIFF files start with 49 49 2A 00 ("II*", little-endian) or 4D 4D 00 2A ("MM", big-endian). The extension and the type a browser reports for an upload both
come from the file name, so check these bytes on the server before trusting a file.
Serve .tiff with the right Content-Type
Content-Type: image/tiff
image/tiff tiff tif;
AddType image/tiff .tiff .tif
@tiff path *.tiff *.tif
header @tiff Content-Type "image/tiff"
curl -sI https://example.com/file.tiff | grep -i '^content-type'
# Content-Type: image/tiff
Set the type in code
res.set('Content-Type', 'image/tiff');
// Or make the browser download it:
res.attachment('file.tiff');
import mimetypes
mimetypes.add_type('image/tiff', '.tiff') # if your system doesn't know it
mimetypes.guess_type('file.tiff')[0] # 'image/tiff'
mime.AddExtensionType(".tiff", "image/tiff")
w.Header().Set("Content-Type", "image/tiff")
Accept .tiff uploads
<input type="file" accept=".tiff,.tif,image/tiff">
The accept attribute only filters the file picker; users can still choose another file. Listing the
extension as well as the type matters, because operating systems don’t always report the type you expect.
Related types
More images
.gif , .webp , .avif , .heic , .ico , .bmp . Look up any extension or type with the MIME type lookup.
Sources
Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.
Frequently asked questions
What is the MIME type for .tiff files?
image/tiff. The full header is "Content-Type: image/tiff".
Why does my server send the wrong Content-Type for .tiff?
Web servers pick the type from the file extension using a table (mime.types in nginx and Apache). If .tiff is missing from that table, they send a default such as application/octet-stream or text/plain. Add the mapping as shown on this page, then check the response with "curl -sI".
How can I check that a file really is TIFF?
Look at the first bytes rather than the extension or the type the browser reports, which both come from the file name. TIFF files start with 49 49 2A 00 ("II*", little-endian) or 4D 4D 00 2A ("MM", big-endian). The MIME type lookup on this site reads them for you when you drop a file on it.