Image width is the number of pixels from the left edge of a picture to its right edge. Image height is the number of pixels from top to bottom. The width usually comes first, so 640 x 480 means 640 pixels wide and 480 pixels high.
In the metadata of a file, Image Width is the field that holds this number. Together with Image Height, it gives the dimensions of the picture. These dimensions are not the file size, which counts the bytes in the file.
Which files carry it
Image formats keep the width in different places inside the file, but always as a count of pixels. Metadata readers show it as Image Width in each of the formats below.
- JPEG keeps the width in the start of frame segment, as a number from 1 to 65535.
- PNG keeps the width in the IHDR chunk, which must be the first chunk in the file. A width of 0 is not valid.
- GIF keeps the width in the logical screen descriptor, as a 2-byte number.
- WebP keeps the width in the VP8, VP8L, or VP8X chunk. A lossy WebP can be at most 16383 pixels wide, and a lossless one 16384.
- TIFF keeps the width in the
ImageWidthtag, ID0x0100.
A JPEG photo from a camera or phone usually carries a second width, the ExifImageWidth tag (ID 0xa002). The Exif standard calls this tag PixelXDimension and requires it in compressed images. It records the valid width of the picture you see.
What the value looks like
The value is a whole number of pixels. The example picture in the Exif standard is 640 x 480 pixels, so its Image Width is 640.
To turn the width into inches or centimetres, divide it by the X Resolution. That field counts how many pixels fit into 1 inch or 1 centimetre.
When the real resolution is unknown, the Exif standard uses 72 pixels per inch. At that setting, a width of 640 pixels prints 8.89 inches wide, which is about 22.6 cm.
The width in the JPEG frame and the Exif width normally match. The Exif standard allows a difference when the encoder adds extra columns on the right as padding. In its example, the Exif tag says 620 while the JPEG frame says 640.
Why it matters for your file
Many upload forms and printing services set limits on image dimensions. The Image Width row lets you check a picture against such a limit before you send it.
On a web page, the width helps the layout. When the HTML gives an image its width and height, the browser can reserve the space before the image loads. This reduces layout shift, where the page content moves when the picture is drawn.
Width also tells you how much detail a picture holds. Multiply the width by the height to get the total number of pixels.
The Megapixels row shows that total in millions. A picture of 640 x 480 has 307,200 pixels, or about 0.3 megapixels.
Check the Orientation row when width and height seem to be swapped. With the value 6 or 8, the viewer turns the picture by 90 degrees before showing it. The width in the file then appears as the height, so a picture saved 640 pixels wide looks 640 pixels tall.