275

I often use JPEG images, and I have noticed that there are two very similar file extensions: .jpg, which my mobile's camera and the Preview application use, and .jpeg, with which Image Capture saves the images from scanning with my Canon MX455 printer. LaTeX doesn't seem to distinguish, as I gave it a .jpeg with the extension changed to .jpg and the result seems to be the same as if it had been a .jpg right from the start. I have wondered what the difference between the two is. I have come across this question, and will certainly read through it, though at the moment I'm slightly out of time. However, from what I saw giving it a quick look, it seems not to distinguish the two extensions. In fact, it seems the file type's name is JPEG and the file extension is .jpg:

JPEG (or JPG, for the file extension; Joint Photographic Experts Group)

(excerpted from the first answer there). So is there any big difference between the two extensions? And if so, what is it?

hippietrail
  • 13,703
  • 15
  • 87
  • 133
MickG
  • 3,086
  • 2
  • 12
  • 20
  • 20
    As a side answer: Never trust an extension... Use the `file` command. – Aurélien May 02 '14 at 10:05
  • 2
    What command is that? Under what menu of the Finder is it? – MickG May 18 '15 at 11:02
  • 2
    You can access the `file` command from the terminal. – Aurélien May 18 '15 at 11:56
  • 1
    What does it do? How is it used? I mean, do I just type `file` or...? – MickG May 18 '15 at 13:08
  • 8
    If you never used the terminal, forget my comment. That was just a side note to remind that, contrary to a common misconception, the extension has little to do with the internal format, and that it is far more robust to analyse the format. – Aurélien May 18 '15 at 13:53
  • I have used the Terminal quite a few times, but I've never heard of `file`. I used the Terminal to run Java programs back when I didn't know about Eclipse, and to use MAGMA, the computer algebra system. – MickG May 18 '15 at 14:21
  • Am I supposed to open it, find the file's directory and access it, and say `file `? – MickG May 18 '15 at 14:21
  • 1
    Yes indeed. `file ` or `file -I ` depending on what you need. – Aurélien May 18 '15 at 16:24
  • 1
    What is the difference? – MickG May 18 '15 at 17:37
  • 1
    The second one is for getting a standard MIME type. The first one to get all the metadata it can find. – Aurélien May 19 '15 at 12:21
  • 9
    One of them was not designed by experts so they left the e out of the file name – Chuck Dec 12 '17 at 17:12

6 Answers6

424

JPG and JPEG stand both for an image format proposed and supported by the Joint Photographic Experts Group. The two terms have the same meaning and are interchangeable.

To read on, check out Difference between JPG and JPEG.

  • The reason for the different file extensions dates back to the early versions of Windows. The original file extension for the Joint Photographic Expert Group File Format was ‘.jpeg’; however in Windows all files required a three letter file extension. So, the file extension was shortened to ‘.jpg’. However, Macintosh was not limited to three letter file extensions, so Mac users used ‘.jpeg’. Eventually, with upgrades Windows also began to accept ‘.jpeg’. However, many users were already used to ‘.jpg’, so both the three letter file extension and the four letter extension began to be commonly used, and still is.

  • Today, the most commonly accepted and used form is the ‘.jpg’, as many users were Windows users. Imaging applications, such as Adobe Photoshop, save all JPEG files with a ".jpg" extension on both Mac and Windows, in an attempt to avoid confusion. The Joint Photographic Expert Group File Format can also be saved with the upper-case ‘.JPEG’ and ‘.JPG’ file extensions, which are less common, but also accepted.

Marwelln
  • 25,688
  • 19
  • 82
  • 110
herohuyongtao
  • 45,575
  • 23
  • 118
  • 159
  • 52
    While @herohuyongtao's answer is correct, much of the quoted text from _differencebetween.com_ may not be outright _wrong_ per se, but it is inaccurate. • The JPEG group were mostly Unix shops, thus the 4-char `.jpeg` extension, not because of Mac. • It was the DOS 8.3 limit that caused the shortening to `.jpg` — windows was just a shell on top of DOS. • The commonly accepted `.jpg` form is because of _programs_ that had to cope with 8.3, not because of windows _users_ being used to it. – Stephen P Aug 06 '15 at 00:24
66

The term "JPEG" is an acronym for the Joint Photographic Experts Group, which created the standard. .jpeg and .jpg files are identical. JPEG images are identified with 6 different standard file name extensions:

  • .jpg
  • .jpeg
  • .jpe
  • .jif
  • .jfif
  • .jfi

The jpg was used in Microsoft Operating Systems when they only supported 3 chars-extensions.

The JPEG File Interchange Format (JFIF - last three extensions in my list) is an image file format standard for exchanging JPEG encoded files compliant with the JPEG Interchange Format (JIF) standard, solving some of JIF's limitations in regard. Image data in JFIF files is compressed using the techniques in the JPEG standard, hence JFIF is sometimes referred to as "JPEG/JFIF".

JamesThomasMoon
  • 3,565
  • 4
  • 29
  • 37
David
  • 2,755
  • 1
  • 25
  • 32
21

No difference at all.

I personally prefer having 3 letters extensions, but you might prefer having the full name.
It's pure aestetics (personal taste), nothing else.
The format doesn't change.

You can rename the jpeg files into jpg (or vice versa) an nothing changes: they will open in your picture viewer.

By opening both a JPG and a JPEG file with an hex editor, you will notice that they share the very same heading information.

Phantômaxx
  • 36,442
  • 21
  • 78
  • 108
13

They are identical. JPG is simply a holdover from the days of DOS when file extensions were required to be 3 characters long. You can find out more information about the JPEG standard here. A question very similar to this one was asked over at SuperUser, where the accepted answer should give you some more detailed information.

Community
  • 1
  • 1
Kevin
  • 641
  • 6
  • 12
8

There is no difference between them, it just a file extension for image/jpeg mime type. In fact file extension for image/jpeg is .jpg, .jpeg, .jpe .jif, .jfif, .jfi

Naveen DA
  • 3,007
  • 3
  • 32
  • 42
3

There's no difference between the file extensions, and they are used interchangeably. I guess the 3-letter version stems from the DOS era...

However, there are different "flavors" of JPEG files. Most notably the JFIF standard and the EXIF standard. Most often these just use .jpg or .jpeg as file extensions, JFIF sometimes uses .jif or .jfif.

Harald K
  • 23,992
  • 6
  • 49
  • 97