File format
What is a JPEG file?
Checked against the sources on Sizes measured
In one paragraph
A JPEG file (.jpg or .jpeg) holds a photograph-style image compressed lossily: it keeps the detail the eye notices and discards much of the rest, which makes it small but means the decoded pixels differ from the original. The coding method is ITU-T Recommendation T.81, approved on 18 September 1992, and MDN describes JFIF, a minimal wrapper defined in JFIF version 1.02, as the format of the files we think of as JPEG images. JPEG has no transparency.
JPEG at a glance
| Property | What the source says | Source |
|---|---|---|
| Media type | image/jpeg (registered in the IANA image registry with reference to RFC 2045 and RFC 2046). | IANA |
| File extensions | MDN lists .jpg, .jpeg, .jpe, .jif and .jfif. They are the same format; the extension is only a name. | MDN |
| How the file starts | With the Start of Image marker, hex FF D8. A JFIF file follows it with an APP0 segment carrying the identifier "JFIF". | ITU-T T.81JFIF 1.02 |
| Compression | Lossy, DCT-based: the image is split into 8 x 8 blocks of samples, transformed and quantised. T.81 also defines progressive and lossless processes. | ITU-T T.81 |
| Sample precision | 8 or 12 bits per sample for the DCT-based processes. | ITU-T T.81 |
| Colour | JFIF uses one component (greyscale, Y) or three components (YCbCr). | JFIF 1.02 |
| Largest image | The frame header stores lines and samples per line as 16-bit numbers: up to 65,535 x 65,535. | ITU-T T.81 |
| Transparency | None. MDN: JPEG does not support an alpha channel. | MDN |
| Browser support | MDN lists all versions of Chrome, Edge, Firefox, Opera and Safari (read on 13 November 2026). | MDN |
Where JPEG's savings come from
A JPEG encoder converts the picture to a brightness channel and two colour-difference channels, cuts each channel into blocks of 8 by 8 samples, and runs a discrete cosine transform on every block. The transform does not lose anything by itself; it re-expresses the block as a mix of smooth and fine patterns. The loss happens next, in quantisation: each pattern's strength is divided by a step size and rounded, and fine patterns get coarse steps. Most of them round to zero and cost almost nothing to store.
That design suits photographs, where fine detail is mostly texture and noise the eye forgives. It suits text, line art and screenshots badly: a sharp edge is made of exactly the fine patterns JPEG discards first, so edges grow faint ripples (ringing) and flat areas next to them pick up blotches. The 8 x 8 grid also shows through as blockiness when the quality is pushed low.
What the quality number means
T.81 defines quantisation tables, not a 0 to 100 quality scale. The number a tool shows, whether a percentage or a value between 0 and 1 as in a browser's canvas, is that encoder's own mapping onto those tables. The same "80%" in two programs can therefore produce different file sizes and different artefacts, and comparing numbers across tools tells you little.
What you can do is measure the trade-off in the encoder you actually use. The measured example on this page shows one step, from 0.82 to 0.90, in the encoder AltFTool's tools use. Note also that re-saving a JPEG decodes and re-quantises it, so every save at a lossy setting can lose a little more detail. Keep an original and export a JPEG from it, rather than editing the JPEG itself again and again.
How to open a JPG or JPEG file
Practically everything opens JPEG: browsers, operating-system photo viewers, office suites, phones. If one particular file will not open, check its first two bytes. Every JPEG stream begins with FF D8; a file named .jpg that starts with anything else is a different format renamed, for example a WebP or HEIC saved under the wrong extension. Converting it with a tool that reads the real format fixes that.
There is no difference between .jpg and .jpeg. Both names are listed for the same image/jpeg format, and renaming one to the other changes nothing inside the file. If an upload form insists on .jpg, a file ending in .jpeg can be renamed safely.
When JPEG is the right format
| Your image | Use JPEG? | Why |
|---|---|---|
| Camera or phone photo to email or upload | Yes | Small files at quality you will not notice, and every system opens them. |
| Form that asks for a photo under a KB limit | Usually yes | Most such forms list JPG; lower the quality or the pixel size until it fits. |
| Screenshot with text | No | Edges ripple and text blurs; PNG or lossless WebP keeps it crisp. |
| Logo on a transparent background | No | JPEG cannot store transparency; the background is filled in. |
| Master copy you will edit again | No | Each lossy re-save can lose a little more; keep a lossless original. |
| Photo for a modern web page | Often not | WebP or AVIF can reach similar fidelity in fewer bytes; JPEG remains the safe fallback. |
Measured example
| File | Bytes | Size | Fidelity to the original |
|---|---|---|---|
| Photo sample, quality 0.82 | 86,531 | 84.5 KB | 36.1 dB |
| Photo sample, quality 0.90 | 144,699 | 141 KB | 37.5 dB |
| Graphic sample, quality 0.82 (transparency filled white) | 28,755 | 28.1 KB | 39.0 dB |
| Graphic sample as PNG (for comparison) | 22,714 | 22.2 KB | 67.2 dB (no pixel off by a whole level) |
Raising the quality from 0.82 to 0.90 took the photo from 84.5 KB to 141.3 KB, 67% more bytes, for a fidelity gain from 36.1 dB to 37.5 dB. One step is one data point; try two or three settings on your own image before settling on one.
On the graphic, JPEG is the wrong tool twice over. At quality 0.82 it produced 28.1 KB, larger than the lossless PNG of the same image (22.2 KB), and it could not keep the transparent background, which the encoder filled with white before compressing.
Questions
Is there a difference between JPG and JPEG?
No. .jpg and .jpeg are two extensions for the same format, image/jpeg. Renaming a file from one to the other does not change its contents.
Can a JPEG have a transparent background?
No. JPEG has no alpha channel. When an image with transparency is saved as JPEG, the transparent areas are filled with a solid colour first. AltFTool's converters fill with white; the Image Converter lets you pick another colour.
Does saving a JPEG again reduce its quality?
It can. Re-saving at a lossy setting decodes the image and quantises it again, which can discard a little more detail each time. Edit from an original and export a JPEG at the end instead.
What JPEG quality should I use?
There is no universal number, because each encoder maps its quality setting differently. Start around the tool's default, compare the result at full size, and step down only if you need a smaller file. On this page's photo, quality 0.90 cost two-thirds more bytes than 0.82.
Why does my JPEG screenshot look blurry around the text?
JPEG quantises the fine patterns that make up sharp edges most heavily, so text and lines pick up ripples and smudges. Save screenshots as PNG or lossless WebP instead.
Sources
- ITU-T (CCITT), copy hosted by W3C, 18 September 1992ITU-T Recommendation T.81 (09/92): Digital compression and coding of continuous-tone still imagesITU-T Recommendation · opened 13 November 2026
- C-Cube Microsystems, copy hosted by W3C, 1 September 1992JPEG File Interchange Format, Version 1.02 (Eric Hamilton)Format specification · opened 13 November 2026
- IANAMedia Types registry, image/* (apng, avif, heic, heif, jpeg, png, webp)Registry · opened 13 November 2026
- MDN Web Docs, 5 November 2026Image file type and format guideReference guide (page last modified 5 November 2026) · opened 13 November 2026
Working with a JPEG file?
Convert a JPG to PNG or WebP, or another image to JPG. The Image Converter runs in your browser tab, with no account.