Take the 2-minute tour ×

What is the difference between "image/png" and "image/x-png"?

share|improve this question
add comment

5 Answers

up vote 40 down vote accepted

The x- prefix is given to non-standard MIME types (i. e. not registered with IANA). So I assume that image/x-png would have been PNG before the MIME type was standardized.

6.3. New Content-Transfer-Encodings

Implementors may, if necessary, define private Content-Transfer-Encoding values, but must use an x-token, which is a name prefixed by “X-”, to indicate its non-standard status, e. g., “Content-Transfer-Encoding: x-my-new-encoding”. Additional standardized Content-Transfer-Encoding values must be specified by a standards-track RFC. The requirements such specifications must meet are given in RFC 2048. As such, all content-transfer-encoding namespace except that beginning with “X-” is explicitly reserved to the IETF for future use.

RFC 2045 — Multipurpose Internet Mail Extensions, Section 6.3

This is also documented in the PNG specification. See FalseVinylShrub's answer.

share|improve this answer
I'm accepting this answer because it's more complete. But could you fold in FalseVinylShrub's info on IE so it's all in one place? –  Aaron Bush Jan 18 '10 at 14:26
Hm, I found the info on IE less valuable than the PNG specification as a hard source. –  Јοеу Jan 18 '10 at 14:46
Lol that's because you aren't trying to figure out why all the pngs are coming from the same company, but only one user is uploading them as X-Pngs:) –  Aaron Bush Jan 18 '10 at 15:24
By the way, shouldn't you have linked to tools.ietf.org/html/rfc2046#section-6 as Content Transfer Encodings are not the same things as Media Types - the principle is clear, though ;-) –  FalseVinylShrub Jan 18 '10 at 16:16
add comment

According to Wikipedia's article on Internet Media Types, and the article it cites...

Types or subtypes that begin with x- are nonstandard

So my guess is "image/x-png" is probably leftover from the days when png was pretty new, and as such, not standardized.

share|improve this answer
I prefer quoting the actual source, which, by the way, is linked directly after the quoted sentence :-) –  Јοеу Jan 18 '10 at 14:12
Actually that's a citation, not a quote... the original RFC doesn't contain the words I quote ;) but I dig what you mean, and added a link thereto. –  Richard JP Le Guen May 14 '10 at 18:30
add comment

image/x-png was the type before PNG was accepted by the IANA as an official mime type.


The official image/png MIME type for PNG, approved on 14 October 1996


share|improve this answer
add comment

According to http://www.w3.org/TR/PNG/#A-Media-type

The internet media type "image/png" is the Internet Media Type for PNG [RFC-2045], [RFC-2048]. It is recommended that implementations also recognize the media type "image/x-png".

So, if you're delivering or uploading a PNG image, 'image/png' is the correct one to use. However, if you're accepting uploads or otherwise interpreting the media type, you are recommended to accept either.

By the way, I found a reference from 2008 that Internet Explorer (version unspecified) was uploading PNG images with a type of image/x-png, so this was a real issue for someone as recently as that.

share|improve this answer
+1. Nice find. I was merely guessing but didn't think of consulting the specification. –  Јοеу Jan 18 '10 at 14:04
+1 Good info on IE! –  Aaron Bush Jan 18 '10 at 14:22
Thanks for contributing to the quest for more reputation ;-) –  FalseVinylShrub Jan 18 '10 at 15:56
I can confirm that IE is "x-png"ing them in IE8. –  Aaron Bush Jan 29 '10 at 16:35
add comment


Here's my experience: I am using the ColdFusion ver 8 language to upload images, and if I upload a .png file, the upload works fine. But -- if I change the file extension of the .png file to .gif -- and then try to upload it, it doesn't work and Cold Fusion returns an error. But if I add "image/x-png" to the list of acceptable file types in the CF upload tag, then it will upload a file with a .gif extension, even though the file is actually a .png. So maybe the "x" in the image type means "it's not actually a "png", it's just masquerading as one...

share|improve this answer
The server doesn't interpret the data in the file, it just does a content-type lookup based on the file's extension. –  dlchambers Jun 22 '12 at 17:48
add comment

Your Answer


