# What is a JPEG file? Everything you need to know about the JPEG format

A **JPEG file** is a compressed raster image designed primarily for photographs and other continuous-tone pictures. JPEG is one of the most widely supported image formats. Files commonly use`.jpg` or `.jpeg`; both extensions represent the same format.

## How does JPEG work?

JPEG divides an image into blocks, converts color data into frequency information, reduces details that human vision is less sensitive to, and compresses the remaining values. This is **lossy compression**: discarded information cannot be recovered from the encoded file.

A quality setting controls the tradeoff. Higher quality preserves more detail but creates a larger file. Repeatedly opening and re-saving a JPEG can compound artifacts, so retain a high-quality source for future edits.

## Benefits of JPEG

* **Universal compatibility:** works in browsers, cameras, editors, office software, and social apps.
* **Good photo compression:** efficient for gradients, textures, and natural scenes.
* **Fast processing:** encoders and decoders are mature and inexpensive to run.
* **Progressive delivery:** progressive JPEGs can show a coarse image before the full file arrives.

## Limitations of JPEG

JPEG does not support alpha transparency or animation. Compression can create ringing, blocking, or blur around text and sharp edges. It is a poor archival choice when exact pixels matter and is often less efficient than WebP or AVIF for web delivery.

Use PNG or SVG for crisp interface graphics, and consider WebP or AVIF when reducing transfer size is more important than supporting very old software.

## JPEG compared with PNG, WebP, and AVIF

|Format|Best fit|Compression|Transparency|
|-|-|-|-|
|JPEG|Photos and maximum compatibility|Lossy|No|
|PNG|Screenshots and exact graphics|Lossless|Yes|
|WebP|General modern web delivery|Lossy or lossless|Yes|
|AVIF|High-efficiency modern delivery|Lossy or lossless|Yes|

## How to optimize JPEG files with Transloadit

[🤖/image/resize](/docs/robots/image-resize.md) can resize, strip unnecessary metadata, and encode a JPEG at a controlled quality:

```json
{
  "steps": {
    ":original": { "robot": "/upload/handle" },
    "jpeg": {
      "use": ":original",
      "robot": "/image/resize",
      "format": "jpg",
      "width": 1600,
      "quality": 85,
      "strip": true
    }
  }
}

```

For additional lossless optimization, pass the result to[🤖/image/optimize](/docs/robots/image-optimize.md).

## JPEG FAQ

### Is JPG different from JPEG?

No. `.jpg` and `.jpeg` are filename extensions for the same image format.

### What JPEG quality should I use?

There is no universal value. Values around 80–85 are a useful starting point for web photographs, but evaluate representative images at the dimensions your users will actually see.

### Does JPEG support transparency?

No. Use PNG, WebP, AVIF, or SVG when transparent pixels are required.

## Related demos

* [Change JPEG quality](/demos/image-processing/change-the-quality-of-a-jpg/)
* [Convert JPEG to WebP](/demos/image-processing/convert-an-image-from-jpg-to-webp/)
* [Watermark an image](/demos/image-processing/image-watermarking/)
