Why do .jpg and .jpeg both exist?


Why do .jpg and .jpeg both exist?

In: 4623

It is the exact same file.

The only difference, is that early window versions only allowed for 3 letter extensions for file names.
Hence JPG, later on, you were able to use more letters, so JPG became JPEG which stands for Joint Photographic Experts Group.

It was originally designed as jpeg.

Some older operating systems (like DOS) can’t do a four-letter extension, they require a three-letter one.

So the three-letter one was used for those, and the four-letter everywhere else.

Nowadays you can use either one since most people’s systems are capable of using the four-letter one, but the desire to make things “backwards-compatible” is very ingrained in web design, so it’s still super common to see the three-letter one.

(Edit to add the word ‘some’ and similar verbiage changes as per corrections in replies.)

In UNIX and Mac systems, a filename extension meant nothing and in fact wasn’t even *really* a thing. You could place a period in a filename if you felt like it but the system didn’t see it as meaning anything special. As far as the OS was concerned, a filename like `abc.def` is just a 7 character filename where the third character happens to be a period for some reason. The `def` wasn’t even stored in a separate field.

In DOS systems, a filename extension was a *different part of* the name stored in a different field that can only be 3 characters. You still see this legacy today in Microsoft’s .NET software, where most system calls that use the word “filename” in their name don’t really mean the whole filename. They mean just the part without the extension.

When JPEG was invented, it wasn’t invented in the DOS world. The original filename extension was supposed to be “.jpeg”. But it got shortened to “.JPG” when working with with DOS systems that couldn’t do 4-character extensions. Even software on the Operating Systems that can handle the full name still had to deal with the fact that they were also going to get a lot of files named the 3-character way because that’s what people who made the files on DOS were going to name them.

The limitation no longer exists in modern version of Windows, but the legacy of people being used to naming JPEG files as “.JPG” for short is still there and it just stuck.

It was originally supposed to be .jpeg, but you had many people using computers at that time that only allowed 3-letter file extensions, so .JPG was the shortened form for them. People using Microsoft products got used to JPG, and it stuck and carried over long after the limitation went away.