WWW FAQs: What image file formats should I use?


2004-01-13: most web pages contain images. GIF, JPEG and PNG are the three major image file formats used in web pages. Other formats are not widely supported by all browsers on all systems, and so they are not suitable for use on the web. ICO files (files ending in .ico) are a special case, used in the browser's "favorites" (bookmarks) list.

  • .jpeg files are by far the best choice for photographs on websites. DON'T use GIF or PNG for photographs on the web.
  • .png files are the best choice for line art, clip art, drawings, logos and other non-photo-realistic images.
  • .gif is often slightly better than PNG for very small icons and other tiny images. GIF is the safest choice when transparency is required. Also, GIF animation can be effective in very, very small doses. On the web, GIF is acceptable for the same purposes as PNG.
  • .ico files are used to store icons displayed in the "favorites" or "bookmarks" list of a web browser, if the user chooses to bookmark your website. For more information, see how do I get my own favorites icon?
  • .bmp is NOT appropriate for the web, ever.

All major graphics programs can produce GIF, JPEG and PNG images. For more information, how do I create images for my site? and how big should my images be?

Legal Note: yes, you may use sample HTML, Javascript, PHP and other code presented above in your own projects. You may not reproduce large portions of the text of the article without our express permission.

Got a LiveJournal account? Keep up with the latest articles in this FAQ by adding our syndicated feed to your friends list!