File height is the vertical size of the picture inside a file, counted in pixels. A metadata report shows this number in the Height row. File width and height together give the size of the picture, for example 1920x1080, where the width comes first.
File height is not the same as file size. Height counts rows of pixels, while file size counts the bytes in the file.
The ffprobe program from the FFmpeg project calls the height of a video stream height. ExifTool has a tag named ImageHeight, which the Image Height article covers. In MOV and MP4 videos, ExifTool takes this tag from the track header, so the 2 numbers can differ.
Which files carry it
Images, videos, and audio files with cover art can report a height. Each format stores a height in its own place:
- MOV and MP4: the video sample description stores the height of the source image in pixels. The track header stores a separate height for the track.
- MKV and WebM: the
PixelHeightelement stores the height of the encoded video frames. - AVI: the AVI header stores an image height.
- PNG: the IHDR chunk stores the height in pixels as a 4-byte number.
Sound has no height, so ffprobe prints no height for an audio stream. An audio file can still show the value when the file holds a cover picture. FFmpeg treats this attached picture as a video stream, and that stream has a height.
The picture frame in an MP3 file has no height field, so the number has to come from the picture data. A FLAC picture block has its own height field, which holds 0 when the height is unknown.
Documents work differently. A PDF page is measured in units of 1/72 of an inch, not in pixels. The Page Size article explains these values.
What the value looks like
The value is normally a whole number of pixels with no unit. FFmpeg lists these video sizes among others, and the second number in each size is the height:
1280x720: a height of7201920x1080: a height of10803840x2160: a height of21607680x4320: a height of4320
A few files show something else. A subtitle stream without a height shows N/A in ffprobe. The height of an SVG image can be a length or a percentage.
Where the value comes from
The program that creates the file sets the height. To change the height, you resize or crop the picture and save the file again.
Why the height can differ from what you see
A video file can store a rotation value, and FFmpeg turns the video according to that value by default. After a turn of 90 degrees, the height you see equals the stored width.
Some formats also keep 2 different heights. In Matroska files, PixelHeight is the height of the encoded frames, and DisplayHeight is the height to display after cropping. The coded height in FFmpeg can also differ from the height when a frame is cropped before output.
Why it matters
Height lets you check a file against a size limit, for example on an upload form. If the Height row shows 720, the video has 720 rows of pixels, even when the file name says 1080.
Height and width also set the number of pixels. A 1920x1080 video has 2,073,600 pixels in each frame, which is about 2.1 megapixels.
For printing, the Y Resolution tag gives the number of pixels per inch or per centimetre in the height direction. Divide the height by that number to get the printed height in the same unit.