A JPEG file can carry image-density information through more than one metadata mechanism. JFIF can store X and Y density values with units such as pixels per inch or pixels per centimeter. EXIF can also carry XResolution, YResolution and a ResolutionUnit. Because software may write, remove or prioritize these fields differently, the same JPEG can appear to have different “DPI” behavior across applications.

The pixel width and height are a separate matter. Those dimensions are part of the image itself.

JPEG is the compression format; metadata surrounds it

People often say “JPG DPI” as if there were one mandatory DPI field inside every JPEG. The real structure is more nuanced.

JPEG defines compressed image coding. Common JPEG files can also contain application-specific segments such as JFIF and EXIF.

Those segments can describe density and other information.

A checker therefore should not merely look for the number 300. It should identify:

  • pixel width and height
  • which density fields are present
  • horizontal and vertical values
  • the units attached to those values
  • potentially conflicting metadata

JFIF density fields

The JFIF specification defines:

  • units
  • Xdensity
  • Ydensity

The units value has defined meanings:

  • 0: no physical unit; X and Y values describe pixel aspect ratio
  • 1: pixels per inch
  • 2: pixels per centimeter

This is important because a density number with unit 0 must not be treated as an absolute DPI value.

If the file says:

  • units = 1
  • Xdensity = 300
  • Ydensity = 300

then the intended density is 300 pixels per inch in both directions.

If units = 2 and the density is about 118 pixels/cm, that corresponds to roughly 300 pixels/inch after conversion.

EXIF resolution fields

EXIF defines XResolution, YResolution and ResolutionUnit.

The resolution values are rational numbers. ResolutionUnit supplies the physical unit.

EXIF is widely used for camera and image metadata, but software can preserve only part of an EXIF block, rewrite it or remove it during export.

This is one reason a newly exported JPEG may not report the same density as the source.

What if JFIF and EXIF disagree?

A robust application should avoid pretending the situation is simpler than it is.

If multiple metadata sources contain different density values, software behavior may vary. One application can prioritize one field; another can use another or normalize the data during import.

A useful checker can report the detected values and explain the source rather than hiding the discrepancy.

For a printing decision, the more dependable calculation is still:

effective PPI = pixel dimensions ÷ final print dimensions

That value is determined by how the raster is used, not by which metadata tag a viewer chooses.

Density does not define the pixel dimensions

Imagine a JPEG with 3600 × 2400 pixels.

At 300 PPI, its nominal print size is:

12 × 8 inches.

At 150 PPI:

24 × 16 inches.

The JPEG still contains 3600 × 2400 pixels in both cases if no resampling occurs.

Changing JFIF or EXIF density metadata can alter the default physical-size interpretation without altering the raster dimensions.

Why export applications change the value

Common causes include:

The exporter writes its own default

An application may create a new JPEG and insert a standard density value rather than copying the original field exactly.

Metadata stripping

Privacy or web-optimization options can remove EXIF and other application metadata.

Unit conversion and rounding

A program may internally represent density in pixels per centimeter or another rational form and then display a rounded PPI value.

Resampling

If an export also changes pixel dimensions while preserving a requested physical size, then the density and raster both legitimately change.

Conflicting fields are normalized

Software may rewrite JFIF and EXIF metadata to make them consistent.

Should an online converter preserve EXIF?

That depends on its purpose and privacy design.

EXIF can contain camera settings and, in some files, location or identifying metadata. A privacy-conscious image service may intentionally strip unnecessary metadata while writing only the density information required for the converted file.

If metadata is preserved, the service should be deliberate about what is retained.

The main converter for this site should make its behavior transparent rather than promising metadata preservation that has not been implemented.

How a JPG DPI checker should report results

A useful report can include:

  • raster dimensions
  • file size
  • JPEG format identification
  • detected JFIF density and units
  • detected EXIF XResolution/YResolution when available
  • whether horizontal and vertical density differ
  • practical print sizes at 150, 200, 240 and 300 PPI

If density is absent, say so. Do not replace “missing” with an invented default and present it as embedded metadata.

Why programs may display 72 or 96 anyway

Some applications need a physical-size assumption when no meaningful density is present.

Historically common defaults can therefore appear in user interfaces.

A displayed fallback is not necessarily a density value that was physically embedded in the JPEG. A diagnostic tool should distinguish:

  • embedded metadata
  • calculated effective PPI
  • an application fallback

That distinction solves many “Why did my image become 72 DPI?” questions.

Related entities and semantic terms

JPEG, JPG, JFIF, EXIF, APP0, metadata, Xdensity, Ydensity, XResolution, YResolution, ResolutionUnit, raster dimensions, PPI.

FAQs

Can a JPEG contain both JFIF and EXIF information?

Yes. Common JPEG files can include multiple application segments, so density-related fields can exist in more than one metadata structure.

What does JFIF density unit 0 mean?

It means the density values are not an absolute physical pixels-per-inch measurement. They describe the pixel aspect ratio relationship.

Why should a checker show the source of a JPEG density value?

Because JFIF and EXIF can carry separate density information. Reporting the source makes conflicting or missing metadata easier to understand.

Does stripping EXIF necessarily remove every possible JPEG density field?

No. JFIF and EXIF are separate structures. An exporter can remove EXIF while retaining or writing JFIF density information.

Closing section

When a JPEG reports an unexpected DPI value, inspect the metadata source before assuming the raster changed. JFIF, EXIF and application defaults can all affect what software displays, while the actual image width and height in pixels remain the foundation for print-resolution calculations.

Source and verification notes

JFIF field meanings were checked against the JFIF specification hosted by W3C. EXIF resolution tags and units were checked against the CIPA EXIF specification. The discussion intentionally avoids claiming that every application uses the same precedence when multiple metadata fields are present.