69

Is there a resource that lists ALL the mimeTypes in existence?

I have found a few places with under 1000 mimeTypes, but then they still don't include common ones like .rar, .fla, .rb, .docx!

Does anyone have a COMPLETE list of mimetypes? Not down to the most obsure "company-only" ones, but at least all of the ones we might use.

Also, I'm looking for a list that maps file extensions to mimeTypes.

1

11 Answers 11

64

http://www.iana.org/assignments/media-types/ lists the "official" mime-types, but it doesn't prevent anyone making their own an not registering it with IANA.

9
  • 1
    is there anything that maps them to file extensions? it doesn't look like iana does...
    – Lance
    Nov 14, 2009 at 21:51
  • 4
    Whilst you can find lists of file extensions mapped to mime-types (ie. reference.sitepoint.com/html/mime-types-full), most lists are not comprehensive. Additionally, a file extension may map to multiple mime-types as it may be used by more than one application. filext.com is a site you might find useful. Nov 14, 2009 at 22:51
  • 22
    There is a pretty good list on stdicon.com : stdicon.com/mimetypes Jan 7, 2010 at 20:34
  • I agree, Paul Tarjan list is actually very complete! Sep 4, 2013 at 20:54
  • 3
    The iana.org list misses some very common ones like .jpg. It has .jpeg, but IMHO leaving stuff like that make the content difficult to use without manipulation. Dec 2, 2014 at 22:21
34

Here's the most up-to-date mime.types maintained by the Apache HTTPD community: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/docs/conf/mime.types?view=annotate

3
8

IANA lists the official ones. A list which includes file extensions which I find useful is the one included as /etc/mime.types in Debian & Ubuntu.

The Apache web server project also maintains a list.

1
  • mime.types is also available on some other systems (/etc/apache2/mime.types in OS X)
    – cobbal
    Nov 14, 2009 at 21:44
7

I collected MIME types and file extensions from many sites and lists, and here's the result: https://s-randomfiles.s3.amazonaws.com/mime/allMimeTypes.txt

I also created a JSON file: https://s-randomfiles.s3.amazonaws.com/mime/allMimeTypes.json

Please tell me if something is missing or incorrect

7
  • it's just missing some standards ;) see iana.org/assignments/media-types/media-types.xml#examples for official ones, yours is a good extra. thanks
    – Heah
    May 27, 2015 at 8:21
  • Your second link is broken, it seems. Can you remove the shorteners?
    – Laurel
    Apr 26, 2016 at 22:45
  • @Laurel It works fine for me, but I can do it later. Also, I know I should update the list.. (Yeah..)
    – SWdV
    Apr 26, 2016 at 23:06
  • @SWdV Can you at least use the full URL? Short links are blacklisted now.
    – Laurel
    Apr 26, 2016 at 23:07
  • @Laurel I don't have any problems with the links (how is it possible you do?) Anyway, here are the links: txt, json. I didn't have much time earlier.
    – SWdV
    Apr 27, 2016 at 14:46
5

iana is tracking the official ones but of course folks can always declare their own...

In other words, it is doubtful you'll ever get the full list on the Planet.

Also consider the case of NPAPI plugins which declare MIME-types just to be be easily accessible... and these MIME-types might be not interesting to you for a reason or another.

3

If your are using Java you could use Apache Tika, which is a powerful library for dealing with file types. With it you can easily get the preferred extension related to a mime type with a couple of rows:

TikaConfig config = TikaConfig.getDefaultConfig();
MimeType mimeType = config.getMimeRepository().forName("image/png"); //Generally your textual mime type
String extension = mimeType.getExtension();
// this would return the extension with the dot. For "image/png" returns ".png"

In this way you don't have to mess with downloading and parsing a file with the associations, I find it very comfortable. This is the way I've done the trick.

2

There is a good Mime Type Table you can find on https://drive.google.com/open?id=0By00BwrZ8886VUg3ak9faG5mTU0 Which is updated 27-02-2017. I am sure that meet your all needful mime type.

1
  • 1
    Link works for me. @Sz: you're right, the list is complete. Apr 22, 2017 at 18:56
1

There's a good table in the classic book "HTTP: The Definitive Guide" by Gourley and Totty (O'Reilly, with a squirrel on the cover) in Appendix D. It appears to be complete and up-to-date as of the time the book was written (in 2002). That was a long time ago, but you'll find all the old favorites there as well as obscure "company-only" ones.

ISBN 1-56592-509-2, http://oreilly.com/catalog/9781565925090/

0
0

Here is a full list that is easy on the eyes:

http://www.webmaster-toolkit.com/mime-types.shtml

1
  • 1
    This list is wrong, it lists mp3 as video as well as audio
    – Akash Kava
    Oct 12, 2012 at 14:51
0

User Paul Tarjan said in a comment:

There is a pretty good list on stdicon.com : stdicon.com/mimetypes

This website is no longer available, but the most recent archive is https://web.archive.org/web/20161015175648/http://www.stdicon.com/mimetypes

Note that this site doesn't mention "application/x-zip-compressed" (and it's not because of the escaping of slashes either) so it's not perfect.

0

I took the list from Apache mime.types as of Fri Sep 29 15:10:29 2017 UTC and wrote a script to convert it to a json mapping. The json is too big for stackoverflow answer. You can find it here mimes.json.

script to generate the mapping:

# mime_to_json.py
# get the mime.types from
# http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/conf/mime.types?view=markup

import sys
import re
import json

mapping = {}
with open(sys.argv[1], "r") as handle:
    for line in handle:
        line = line.strip()
        if line[0] == "#":
            continue
        parts = re.split("\s+", line)
        mime = parts[0]
        del parts[0]
        for ext in parts:
            mapping[ext] = mime

print(json.dumps(mapping, indent=4, sort_keys=True))

Not the answer you're looking for? Browse other questions tagged or ask your own question.