Pixel Counter

Read an image’s original dimensions, count pixels, and compare it with the measurements in Three.js.

  • File & Data
  • Runs in your browser
  • Free, no signup

The guide

Tested tool guide Tested browser tools Checked November 30, 2026

What Pixel Counter does, with a checked example

Open a local image to see its original upright dimensions, total pixels and aspect ratio. The report includes the detected format and the file size in bytes. Three.js compares the image thumbnail with the measurement report.

Worked example

A concrete input and expected output from the current implementation.

Input

Choose Load example for a 640 × 480 picture.

Expected output

307,200 pixels, 0.3072 megapixels and a 4:3 aspect ratio.

Multiply 640 by 480 to count the pixels. Divide both dimensions by their greatest common divisor, 160, to get 4:3.

How the result is produced

1

Read the original dimensions

The tool opens the selected file in the browser and reads its original dimensions after orientation. The display may use a smaller thumbnail.

2

Calculate the size and shape

Width times height gives the pixel count. Divide by one million for megapixels. The simplified width and height give the aspect ratio.

3

Review the file details

The format comes from the file content. The byte size describes how much storage the uploaded file uses. Copy measurements saves the shown values as plain text.

Good uses

  • Check the dimensions of a local photo.
  • Compare a picture with an aspect-ratio requirement.
  • Record pixel counts for a batch of design assets one file at a time.

Limits and checks

  • Use dimensions in pixels when comparing with a screen or export target.
  • Check the upright orientation when using a photo that rotated after capture.
  • Use file bytes for storage estimates and pixels for image dimensions.

Common questions

Does a compressed image have fewer pixels?

Compression can change file size while preserving the width, height and pixel count.

Does the preview resize the measurements?

The report uses the original upright image dimensions even when a smaller thumbnail is drawn.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.