File Formats
What Is JPG? How the JPEG Format Works and When to Use It
JPG is the lossy image format that has stored the world's photos for more than three decades. Here is how JPEG compression works, where it shines, where it fails and what to watch for when converting.
Author: Hemen Dönüştür Editör EkibiPublished: 7 min read

JPG (or JPEG) is a lossy image format designed to store photographs in small files. Most of the pictures you come across, from the shots your phone takes to the photos on a news site, use it. This article explains where JPG came from, how it makes files small, what it is good and bad at, and what to keep in mind when you convert to or from it.
Are JPG and JPEG the same thing?
Yes. JPEG stands for the Joint Photographic Experts Group, the committee that wrote the standard. The .jpg extension became common because early Windows and DOS file systems limited extensions to three characters. Files ending in .jpg, .jpeg, .jpe and .jfif use the same compression and most software opens them the same way. The MIME type is always image/jpeg.
A short history
According to the JPEG committee, standardization work began in 1986. The resulting text was approved by the CCITT (as the ITU's standards body was then called) on 18 September 1992 as Recommendation T.81, and the identical text was published as the international standard ISO/IEC 10918-1. Its formal title is "Digital compression and coding of continuous-tone still images".
T.81 defines the compression method, but it does not fully specify how a file should interpret color. JFIF (JPEG File Interchange Format) filled that gap. According to the Library of Congress format description, JFIF was originally developed by Eric Hamilton of C-Cube Microsystems and published in 1992. Essentially the same document became ITU-T Recommendation T.871 in 2011 and ISO/IEC 10918-5 in 2013. What we call a "JPG file" today is usually a JPEG stream wrapped in JFIF or in the EXIF structure that cameras use.
How JPEG compression works
JPEG shrinks files by throwing away detail the human eye is unlikely to notice. The main steps are:
1. Color conversion and chroma subsampling
The image is converted from RGB into a brightness component (Y) and two color difference components (Cb and Cr). Because the eye is much more sensitive to changes in brightness than in color, the color components are usually stored at a lower resolution. With the most common scheme, 4:2:0, one color value is kept for every 2x2 block of pixels. In photos this is almost invisible, but sharp color transitions such as red text or thin colored lines can look smeared.
2. 8x8 blocks and the DCT
As T.81 describes, each component is split into 8x8 blocks of samples, and each block is transformed with the discrete cosine transform (DCT) into frequency coefficients. This separates flat areas (low frequencies) from fine detail (high frequencies).
3. Quantization, where the loss happens
The coefficients are divided by a quantization table and rounded. Most high frequency coefficients become zero, and this is where information is actually discarded. The "quality" slider in an editor controls how aggressive those tables are: lower quality zeroes more coefficients and produces a smaller file.
4. Entropy coding
The remaining coefficients are read in zigzag order and coded losslessly. The baseline process uses Huffman coding; the standard also allows arithmetic coding, but that option is rarely supported in practice. The baseline process uses 8-bit precision per component, while the extended processes can use up to 12 bits.
Progressive JPEG
The standard also defines a progressive mode, in which the image is coded in several scans that start blurry and get sharper, rather than in a single top-to-bottom pass. On slow connections the page looks complete sooner, and the file is often slightly smaller.
Strengths and weaknesses
| Feature | JPG |
|---|---|
| Compression | Lossy; the quality setting trades file size against image quality |
| Transparency (alpha) | None |
| Animation | None |
| Color depth | 8 bits per component (24-bit color) in common use |
| Compatibility | Supported by virtually every browser, operating system, camera, printer and upload form |
| Best for | Photographs and images with smooth gradients |
| Weak at | Text, screenshots, logos and graphics with hard edges |
MDN's image format guide describes JPEG as a good choice for lossy compression of still images, and recommends PNG when more precise reproduction is needed, or WebP and AVIF when you want both better reproduction and higher compression.
How widely is JPG used?
W3Techs data from October 2026 shows JPEG on 68.8% of the websites it monitors, second only to PNG (74.9%). The HTTP Archive Web Almanac 2024 media chapter reports that 32.4% of images on mobile pages are JPEG, still the largest share of any format. The same report notes that JPEG fell from about 40% of all images in 2022 to 32% in 2024, a drop of eight percentage points, while WebP gained about three points, SVG a little under two and AVIF almost one.
The almanac also compares efficiency: the median JPEG on mobile uses 2.0 bits per pixel, against 1.3 for WebP, 1.4 for AVIF and 3.8 for PNG. These are medians of images actually served on the web, not the same picture encoded in each format, but they show why newer formats are gaining ground.
Common problems
Transparent areas turn white or black
JPG has no alpha channel, so when you convert a transparent PNG to JPG the transparent pixels have to become a solid color. Some programs use black, others white. If your logo will sit on a colored background, either keep it as PNG or pick the background color during conversion.
Noise around text and lines
Working in 8x8 blocks and discarding high frequencies causes "ringing", faint smudges around high-contrast edges. At low quality the block boundaries themselves become visible. For screenshots and graphics with text, PNG or lossless WebP is the right choice.
The cost of saving again and again
Every time you open a JPG and save it as JPG again, it is quantized again and small losses pile up. If you are editing, keep the original, or keep your working copy in a lossless format such as PNG.
Photos that appear sideways
Cameras often store an "orientation" value in EXIF instead of rotating the pixels. Older software that ignores this value shows the photo sideways or upside down.
Tips for converting to and from JPG
- A quality of 80 to 90 suits most photos. Our PNG to JPG converter starts at 90; lower the slider for a smaller file. A quality of 100 makes the file much larger but does not make it lossless.
- Choose a background color for transparency. Our tool fills transparent areas with white by default, and you can pick the color of the page the image will sit on instead.
- Converting JPG to PNG does not bring lost quality back. A JPG to PNG conversion prevents further losses during editing, but the file usually gets bigger.
- For smaller web images, try converting JPG to WebP or JPG to AVIF. To shrink a JPG while keeping it a JPG, use the image compressor, which re-encodes JPG at quality 75 by default and shows the size before and after.
- Location and camera data. Our image tools do not write EXIF, location or camera data to the output, and the correct photo orientation is applied before encoding. These conversions run in your browser, so your files never leave your device.
Frequently Asked Questions
Is there a quality difference between JPG and JPEG?
No. They are the same format with different extensions. Renaming a file from .jpeg to .jpg does not change its contents.
Can a JPG be saved losslessly?
T.81 does define a lossless process, but common software and browsers almost never support it. In practice JPG is a lossy format: even quality 100 is not an exact copy, because of quantization and chroma subsampling.
Does JPG support a transparent background?
No. If you need transparency, use PNG, WebP or AVIF. When a transparent image is converted to JPG, the transparent areas are filled with a solid color of your choice.
Which quality value should I choose?
For photos, 80 to 90 is usually a good balance. For images with text or sharp edges, use 90 or higher, or stay with PNG. Quality numbers do not mean exactly the same thing in every program, so checking the result with your own eyes is the most reliable test.
Should I use JPG or WebP?
If the image is only for your website, WebP usually gives a smaller file at the same quality and opens in every current browser. If you will email, print or upload the image to older software, JPG is the safer choice.
Sources
- ITU-T (CCITT) Recommendation T.81 (09/92), W3C copy
- JPEG committee: JPEG 1 (ISO/IEC 10918) overview
- Library of Congress: JPEG File Interchange Format (JFIF)
- ITU-T T.871: JPEG File Interchange Format
- MDN: Image file type and format guide
- W3Techs: Usage statistics of image file formats for websites
- HTTP Archive Web Almanac 2024: Media


