What Is JPG/JPEG? The Complete Guide to the World's Most Popular Image Format
Open any photo on your phone, download an image from the web, or attach a picture to an email — there is a better than 80% chance you are working with a JPG file. It is the single most widely used image format in the world, built into virtually every camera, smartphone, operating system, and web browser made in the last three decades. And yet most people have no idea how it actually works, or when they should stop using it.
This guide explains what JPG (JPEG) is, how its compression algorithm works in plain English, what it is best and worst suited for, and how it stacks up against the modern alternative — WebP.
What Is JPG / JPEG?
JPG — or JPEG, depending on who you ask — is a standardised image compression format created by the Joint Photographic Experts Group in 1992. The format was designed with a single goal: make photographic images dramatically smaller so they could be stored on hard drives, transmitted over slow modem connections, and displayed on the low-powered computers of the early internet era.
It succeeded spectacularly. A typical 12-megapixel photograph from a digital camera might weigh 8–10 MB as an uncompressed bitmap. Saved as a JPG at typical quality settings, the same image might be 2–4 MB — sometimes under 1 MB — with no visible difference to the naked eye. That compression ratio changed photography, the internet, and digital communications permanently.
Today, JPEG is formally specified as ISO/IEC 10918 and is supported natively by every browser, every operating system, every smartphone, and the vast majority of software that handles images.
What Does JPG Stand For? JPEG vs JPG — Are They the Same?
Yes, they are exactly the same format. The name JPEG stands for Joint Photographic Experts Group — the ISO/ITU committee that designed the standard. The file extension was shortened to .jpg for a purely historical and technical reason: early versions of Windows (running on MS-DOS) enforced a three-character limit on file extensions, so .jpeg was truncated to .jpg.
Mac OS and Unix systems never had this restriction and accepted .jpeg from the start. Today, both extensions are used interchangeably, and every application that handles one automatically handles the other. There is no difference in compression, quality, or capability between a file named photo.jpg and one named photo.jpeg.
How JPEG Compression Works — DCT Explained in Plain English
JPEG compression is built on a mathematical technique called the Discrete Cosine Transform (DCT). The algorithm does not simply throw away random pixels — it is far more intelligent than that. It exploits a fundamental property of human vision: we are far more sensitive to variations in brightness than to variations in colour, and we are much better at detecting large-scale patterns than fine high-frequency detail.
Here is what happens inside the encoder, step by step:
- Colour space conversion. The image is converted from RGB (red, green, blue) to YCbCr — a format that separates luminance (brightness, Y) from chrominance (colour information, Cb and Cr). The colour channels are then downsampled, typically to half their resolution, because the human eye tolerates colour blur far better than brightness blur. This alone is responsible for a large part of JPEG's size reduction.
- Block splitting. The image is divided into a grid of small 8×8 pixel blocks. Each block is processed independently.
- Discrete Cosine Transform. Each 8×8 block is passed through the DCT, which converts the 64 pixel values into 64 frequency coefficients. Think of it as describing the block in terms of waves rather than individual dots. One coefficient represents the overall average colour of the block (the "DC" coefficient). The remaining 63 represent progressively finer patterns — from gentle gradients to fine-grained texture (the "AC" coefficients).
- Quantisation — the lossy step. Each frequency coefficient is divided by a value from a quantisation table. The table uses small divisors for low-frequency (coarse) detail — preserving it precisely — and large divisors for high-frequency (fine) detail, which rounds those values aggressively, often to zero. This is where data is permanently discarded. The quality setting (1–100) controls how aggressive the quantisation table is.
- Entropy coding. The quantised coefficients (now mostly zeros for high frequencies) are compressed losslessly using Huffman coding, which efficiently encodes runs of identical values. This is the final stage and is entirely reversible.
When you open a JPEG, the process runs in reverse — except that the discarded high-frequency detail cannot be recovered. The decoder reconstructs the image from the surviving coefficients, and the visual result is an approximation of the original that your eye typically cannot distinguish from the real thing at quality settings of 80 or above.
Lossy Compression — What It Means in Practice
JPEG is a lossy format. Unlike ZIP, PNG, or FLAC — which are lossless and reproduce source data bit-for-bit — JPEG permanently discards information during compression. The discarded detail is chosen carefully to be information your visual system is unlikely to notice, but it is gone.
This has two practical consequences you need to understand:
Quality settings (1–100)
Most software exposes a quality slider from 1 to 100 when saving a JPEG. This number directly controls how aggressively the quantisation step throws away high-frequency detail:
- Quality 90–95 — near-lossless in appearance. File sizes are large (often 60–80% of the original uncompressed size). Suitable for archiving, professional printing, or any image you intend to re-edit.
- Quality 75–85 — the sweet spot for most photographs. Excellent visual quality, file sizes 20–40% of uncompressed. This is what most digital cameras use as their default, and what most web publishing workflows target.
- Quality 60–74 — acceptable for web thumbnails, email previews, and images displayed at small sizes. Compression artefacts (the blocky 8×8 patterns) become visible on close inspection, especially in smooth gradients and skies.
- Quality below 60 — significant visible artefacts. Suitable only for very small file size targets where quality is not critical, such as image previews or favicons.
Re-save degradation (generation loss)
Every time you open a JPEG, edit it, and save it again, the image is re-encoded from scratch. Each re-encode applies a new round of quantisation to an image that has already been quantised — stacking additional loss on top of existing loss. After several re-saves, visible artefacts accumulate even at high quality settings.
The practical rule: never use JPEG as a working format. Keep original or working copies as PNG, TIFF, PSD, or a RAW camera file. Export to JPEG only at the final delivery stage, and only once.
What JPG Is Best For
JPG's compression algorithm is specifically tuned for continuous-tone photographic content — images where colour values transition gradually across large areas. It excels at:
Photographs
The format it was designed for. Portraits, landscapes, product photos, travel shots — JPEG is ideal when the image has smooth tonal gradations and rich colour variation.
Social Media Images
Twitter, Facebook, Instagram, and LinkedIn all use JPEG internally for photos. Uploading as a high-quality JPEG (85+) preserves appearance after the platform's own re-compression.
Email Attachments
Universal compatibility means any email client on any device can open a JPEG without needing additional software. Smaller than PNG for the same photo.
Digital Cameras
The majority of point-and-shoot cameras and smartphone cameras save images as JPEG by default. Even DSLRs with RAW capability default to JPEG for casual shooting.
Web Photography
Product photography, hero banners, blog post images, and press photos all benefit from JPEG's compact size. Smaller files mean faster page loads.
Print Output
High-quality JPEGs (90–95) are accepted by professional print labs and are indistinguishable from lossless originals at typical print resolutions.
What JPG Is NOT Good For
JPEG struggles badly with certain types of content. The DCT's 8×8 block structure creates visible artefacts wherever there are sharp edges, flat areas of solid colour, or fine text. Never use JPEG for:
- Logos and icons — the hard edges of vector-style graphics produce visible blocky artefacts around every contrast boundary. Use PNG or SVG.
- Screenshots — screenshots typically have flat colour areas and sharp text. JPEG compression introduces smearing and colour fringing around characters. Always screenshot as PNG.
- Images with text overlaid — infographics, presentation slides, charts, and watermarks all require lossless compression to remain legible at small sizes.
- Images requiring transparency — JPEG has no alpha channel. Any transparent regions are filled with a solid colour (typically white or black depending on the encoder). Use PNG or WebP for transparency.
- Animated images — JPEG supports only a single static frame. For animation, use GIF, WebP, or AVIF.
- Source files you plan to edit again — as covered above, every re-save degrades quality. Keep working files in a lossless format.
JPG Advantages — Why It Has Lasted 30 Years
- Universal compatibility. Every browser, operating system, printer driver, and image editor ever made supports JPEG. There is no format on earth with wider support.
- Excellent compression for photographs. At quality 80, a JPEG photograph is typically 10–20× smaller than the same image in uncompressed bitmap form, with no visible quality difference for most viewers.
- 16.7 million colours. JPEG stores 8 bits per channel (red, green, blue) — 24-bit colour — reproducing the full gamut a standard monitor can display.
- EXIF metadata support. JPEGs carry embedded metadata: camera make and model, aperture, shutter speed, ISO, GPS coordinates, date and time. This makes them the standard for photo management and geotagging.
- Progressive loading. Progressive JPEGs can be encoded to load in multiple passes — a low-resolution preview appears immediately while the full image loads, improving perceived performance on slow connections.
- Hardware acceleration. JPEG encoding and decoding is implemented in hardware on virtually every modern CPU, GPU, and image signal processor (ISP), making it extremely fast to encode from a camera or decode on a device.
JPG Disadvantages
- Lossy compression with no recovery. Once you save a JPEG and discard the original, the lost detail is gone permanently. Each re-save compounds the loss further.
- No transparency support. The format cannot represent an alpha channel. Any image element that needs to appear on different coloured backgrounds must be saved as PNG or WebP.
- Poor for sharp edges and text. The 8×8 DCT block structure creates ringing and fringing artefacts around hard contrast boundaries — especially visible in logos, diagrams, and screenshots.
- No animation. JPEG is a single-frame format with no support for motion or frame sequences.
- Less efficient than modern formats. WebP typically achieves 25–35% smaller file sizes at the same visual quality. AVIF achieves 40–50% smaller. JPEG's age shows in its compression efficiency compared to codecs designed with modern mathematical tools.
- Compression artefacts at low quality. Pushed to very small file sizes, the blocky 8×8 pattern of the DCT becomes prominently visible — particularly in smooth gradients like sky, skin, or background fills.
Common JPG Use Cases in 2026
Despite being over three decades old, JPEG remains the dominant image format for several reasons. Here are the scenarios where it is still the right tool:
- Digital cameras and smartphones. The JPEG pipeline is baked into camera hardware at the firmware level. Unless you shoot in RAW mode, your camera outputs JPEG.
- Email photo attachments. Attaching photos to email? JPEG is the safe choice — every email client on every device handles it without plugins or conversion.
- Social media uploads. Most platforms apply their own JPEG re-compression on upload anyway. Uploading as a high-quality JPEG (Q85+) minimises the cumulative degradation from double compression.
- Stock photography and image libraries. Getty, Shutterstock, Adobe Stock, and similar platforms distribute images as JPEG. It remains the standard for commercial photography delivery.
- Web images where WebP is not yet set up. For teams that haven't configured a build pipeline to serve WebP automatically, JPEG is a reliable fallback with universal support.
- Printing. Professional labs and consumer photo printers all accept JPEG. For print at 300 DPI, a quality 90+ JPEG is visually identical to a TIFF.
Convert JPG to WebP — Free, Instant, Private
Make your JPEG images 25–35% smaller with no visible quality loss. Our converter runs entirely in your browser — your files never leave your device.
JPG vs WebP — Direct Comparison
WebP was released by Google in 2010 as a direct successor to JPEG for web images. It uses a modern compression algorithm (based on VP8 video coding) that was designed with the mathematical shortcomings of DCT block coding in mind. Here is how the two formats compare across every meaningful dimension:
| Feature | JPG / JPEG | WebP |
|---|---|---|
| Compression type | Lossy only | Lossy and lossless |
| Typical file size vs JPG | Baseline | 25–35% smaller at equivalent quality |
| Transparency (alpha) | Not supported | Supported |
| Animation | Not supported | Supported |
| Browser support | 100% — all browsers, all versions | 97%+ — all modern browsers (not IE11) |
| OS / software support | Universal — every OS and app | Good on modern OS; older apps may lack support |
| Compression artefacts | Visible 8×8 blocks at low quality | Smoother — no block boundary artefacts |
| EXIF metadata | Full EXIF support | EXIF supported (Exif in WebP container) |
| Max colour depth | 24-bit (8 bits/channel) | 24-bit + optional 10-bit (HDR profile) |
| Year introduced | 1992 | 2010 |
| Best for | Photos, email, cameras, print | Websites, web apps, page speed |
When to Convert JPG to WebP — and Why It Matters for Page Speed
If you are building or maintaining a website, converting your JPEG images to WebP is one of the highest-leverage performance improvements you can make — and it requires no changes to your design or content.
Here is why it matters concretely:
- Core Web Vitals. Google's Largest Contentful Paint (LCP) metric measures how quickly the main image on a page loads. Smaller WebP files load faster, directly improving your LCP score — which is a confirmed ranking signal in Google Search.
- PageSpeed Insights. Google's PageSpeed tool flags "Serve images in next-gen formats" as an audit. Switching your JPEGs to WebP will typically eliminate this warning and add several points to your Performance score.
- Bandwidth costs. A site serving 10,000 photo pages per day at an average image size of 300 KB (JPEG) vs 200 KB (WebP) saves 1 GB of bandwidth per day. At scale, that translates to real hosting cost savings and faster load times on mobile networks.
- Mobile experience. On cellular connections — 4G or 5G with variable signal — the 25–35% size reduction from WebP has a noticeable effect on how quickly images appear, particularly for users on slower connections or in areas with limited coverage.
The practical rule for websites: serve WebP to modern browsers and JPEG as a fallback using the <picture> element with separate <source> tags. Or, if you use a CDN like Cloudflare or an image service like Cloudinary or Imgix, enable their automatic WebP conversion and they handle the fallback logic for you.
For email, social media uploads, and file sharing, JPEG remains the more compatible choice. WebP support in desktop email clients and older image editors is still inconsistent as of 2026.