FileExamples
.jpg

JPG File Format

JPEG (JPG) is the most widely used lossy image format, ideal for photographs and complex images with millions of colors.

Extension .jpg
MIME image/jpeg
Magic Bytes FF D8 FF
Encoding DCT-based lossy compression
Compression JPEG (Baseline, Progressive, Lossless)
Spec ITU-T T.81 / ISO/IEC 10918-1
Max Size 65,535 × 65,535 pixels

Sample JPG Files

View all
File NameSizeDescriptionAction
Profile Picture245 KBDownload
Landscape Photo380 KBDownload

Overview

JPEG (Joint Photographic Experts Group) is the world's most popular image format, using lossy compression to achieve small file sizes while maintaining acceptable visual quality. JPEG supports 24-bit color (16.7 million colors) and uses the Discrete Cosine Transform (DCT) algorithm to compress image data. The format is ubiquitous in digital photography, web publishing, social media, and print. Quality can be adjusted from 1 (maximum compression) to 100 (minimum compression), allowing fine control over the size-quality trade-off.

History

The JPEG standard was developed by the Joint Photographic Experts Group and published as ITU-T T.81 and ISO/IEC 10918-1 in 1992. It quickly became the dominant format for digital photography due to its efficient compression. EXIF metadata support was added for digital cameras. JPEG 2000 (2000) offered wavelet-based compression but never replaced the original. More recent alternatives include WebP (2010), AVIF (2019), and JPEG XL (2022), though JPEG remains dominant due to universal support.

File Structure

A JPEG file begins with the SOI (Start of Image) marker 0xFFD8, followed by segments: APP0/APP1 (JFIF/EXIF metadata), DQT (quantization tables), SOF (frame header with dimensions), DHT (Huffman tables), SOS (Start of Scan with compressed data), and EOI (End of Image) marker 0xFFD9. The compressed data uses 8×8 pixel blocks transformed via DCT and quantized based on quality settings.

Common Use Cases

  • Digital photography and camera output
  • Web images and social media
  • Email attachments and document embedding
  • Print and publishing workflows
  • Product photography for e-commerce
  • Medical imaging (DICOM wraps JPEG)
  • Thumbnails and image previews
  • Background images and banners

Advantages

  • Universal support across all devices and browsers
  • Excellent compression for photographs
  • Adjustable quality-to-size ratio
  • Small file sizes ideal for web and email
  • EXIF metadata for camera settings and GPS
  • Hardware-accelerated decoding on most devices

Disadvantages

  • Lossy compression — quality degrades with each re-save
  • No transparency (alpha channel) support
  • Not ideal for text, line art, or flat graphics
  • No animation support
  • Visible compression artifacts at low quality

Frequently Asked Questions

What is a JPG file?

A JPG (JPEG) file is a compressed image format that uses lossy compression to reduce file size while maintaining visual quality. It is the most common format for photographs and web images.

What is the difference between JPG and JPEG?

JPG and JPEG are the same format. The shorter .jpg extension originated from Windows' 3-character extension limit. Modern systems support both .jpg and .jpeg interchangeably.

JPG vs PNG — which should I use?

Use JPG for photographs and complex images with many colors. Use PNG for graphics with transparency, text, logos, or flat colors. JPG is smaller but lossy; PNG is lossless but larger.

Can I convert JPG to PNG?

Yes. You can convert JPG to PNG using image editors (Photoshop, GIMP), online converters, or command-line tools like ImageMagick. Note that converting doesn't restore lost quality from JPEG compression.