How to use the jpeg structure viewer
- Choose a JPEG file (up to 25 MB) or drop it on the box.
- Read the figures: pixel size, baseline or progressive, chroma subsampling, scans and the quality estimate.
- Open a quantization table to see its 64 numbers, and check the notes for problems such as a missing end marker.
- Read the list of segments in order, and save it as CSV or copy it as text.
How a JPEG file is built
A JPEG file is a sequence of segments. Each starts with the byte FF and a marker code, followed by a length. The start of image marker (FF D8) opens the file and the end of image marker (FF D9) closes it. In between come application segments (APP0 to APP15) that carry the JFIF header, Exif camera data, XMP, color profiles and other metadata, comments, the quantization tables (DQT), Huffman tables (DHT), the frame header (SOF) that gives the size, bit depth and color components, and one or more scans (SOS) followed by the compressed image data.
The viewer walks those segments without decoding the picture. It shows the offset, marker and size of each, and reads out the useful details: pixel dimensions, whether the file is baseline (one scan) or progressive (several), how the color channels are sampled, and what kinds of metadata are stored. A progressive file made by a common encoder showed ten scans, and sampling of 4:2:0 appears when the two color channels have half the resolution of brightness in both directions.
Quantization tables and the quality estimate
JPEG compresses by dividing frequency values by the numbers in a quantization table and rounding. Larger numbers throw away more detail. Many encoders have a quality setting from 1 to 100 that scales a standard table: the numbers are multiplied by 5000 divided by the quality below 50, or by 200 minus twice the quality above it, then divided by 100 and kept between 1 and 255. The viewer compares the tables in your file with that scale and reports the closest setting, marked as an exact match when the tables are identical to that scale.
Test files saved at settings of 10, 50, 75, 92 and 100 were all recognized exactly, and the 64 numbers of every table agreed with the Pillow imaging library. A file edited by another program, or made by an encoder with its own tables, gives only an approximate figure and is marked as having custom tables. The estimate describes the tables, not the look of the picture, and the same setting on two encoders can differ. See the image metadata viewer for Exif details and the PNG chunk viewer for the PNG format.
Limits and privacy
The file is read on your device and nothing is uploaded. Only JPEG files are accepted: the first bytes are checked, so a file that is really an SVG drawing, PNG or other format is refused whatever its name. The picture is not drawn. Comments are shown as plain text. A file that is cut short, or has extra data after the end marker, is reported in the notes. To shrink a file, try the image compressor or the compress image to target file size tool.
Assumptions and limits
- The file starts with FF D8 FF. Other formats, including SVG, are refused by their first bytes.
- The quality estimate assumes the libjpeg scale applied to the standard tables; other encoders may differ.
- Only 8-bit and 16-bit quantization tables are read, and lossless and arithmetic-coded variants are listed but not analyzed further.
- Segments are listed up to 300 rows; the CSV holds all of them.
Frequently asked questions
What does 4:2:0 mean?
It describes how color information is sampled compared with brightness. In 4:2:0 the two color channels have half the width and half the height of the brightness channel, which saves space with little visible effect in photos. 4:4:4 keeps full color resolution.
What is the difference between baseline and progressive JPEG?
A baseline file stores the picture in one pass from top to bottom. A progressive file stores several passes, each adding detail, so a blurry version can show before the file has loaded fully. Both decode to the same kind of picture.
Why is the quality figure marked custom?
The tables in the file do not match the standard scale at any setting. Some cameras, phones and editors use their own tables, so the number is only the nearest standard setting and not a true quality.
What are the extra bytes after the end marker?
Some devices append data after FF D9, such as a second image or a depth map, which most viewers ignore. The viewer reports the number of bytes so you know the file holds more than one picture.