induwara.lk
induwara.lkDeveloper · Image & Video

PSNR Calculator — Peak Signal-to-Noise Ratio

Compute PSNR in decibels for image and video quality. Enter a known MSE and bit depth, or paste two pixel-value lists and let the tool derive the MSE first. You get the PSNR, the MAX peak value, a plain-English quality band, and the full derivation. Formula verified against scikit-image and MATLAB.

By Induwara AshinsanaUpdated Jun 20, 2026
Calculate PSNR
scikit-image · MATLAB verified

Peak value MAX = 255 (28 − 1)

The mean of the squared pixel differences. Use 0 for identical images (PSNR is then infinite).

Quick presets
PSNR
34.15 dB
MSE used
25
MAX (peak value)
255
Quality band
Good

Typical acceptable compression quality.

Derivation

PSNR = 10·log10(255² / 25) = 34.15 dB

Cross-checked via 20·log10(MAX) − 10·log10(MSE) = 34.15 dB

Quality bands are a conventional rule of thumb for 8-bit images, not part of any standard. Formula verified against .

How it works

PSNR (Peak Signal-to-Noise Ratio) measures how close a reconstructed signal — a compressed, denoised or super-resolved image — is to its original. It is the standard objective metric for image- and video-compression work, reported on a logarithmic decibel scale where a higher number means less distortion. This calculator follows the same definition used by scikit-image and MATLAB.

  1. Find the peak value. The maximum representable pixel value is MAX = 2^bits − 1: 255 for an 8-bit image, 1023 for 10-bit, 4095 for 12-bit, 65535 for 16-bit.
  2. Get the MSE. If you already know the mean squared error, enter it directly. Otherwise the tool computes it from your two pixel lists using MSE = (1/N)·Σ (xᵢ − yᵢ)² — the average of the squared differences between the original values xᵢ and compressed values yᵢ over N samples.
  3. Apply the PSNR formula. PSNR = 10·log10(MAX² / MSE), measured in decibels. This is algebraically the same as 20·log10(MAX) − 10·log10(MSE), and the calculator shows that second form as an independent cross-check so you can see both agree to the rupee — here, to the decibel.
  4. Handle the identical case. When the two signals match exactly, MSE = 0 and the ratio is divided by zero, so PSNR is mathematically infinite. Rather than erroring, the tool reports ∞ dB and labels it as lossless.

The coloured quality band (Excellent ≥ 40 dB, Good 30–40 dB, Acceptable 20–30 dB, Poor < 20 dB) is a widely-cited engineering heuristic for 8-bit images, useful for a quick read but not part of any formal standard — the page states this clearly next to the result. PSNR also has known limits: it scores pixel error, not perceived quality, so it can disagree with the eye. For perceptual work, pair it with SSIM or a learned metric. All maths here runs in your browser; nothing is uploaded.

Worked examples

From MSE, 8-bit

MSE = 25 · bit depth 8 · MAX 255

  1. Peak value: MAX = 2^8 − 1 = 255
  2. Ratio: MAX² / MSE = 255² / 25 = 65025 / 25 = 2601
  3. PSNR = 10·log10(2601) = 10 × 3.41514
  4. PSNR = 34.15 dB → band: Good

From two pixel lists, 8-bit

Original [100, 150, 200, 50] vs Compressed [105, 148, 195, 60]

  1. Differences: −5, 2, 5, −10
  2. Squared: 25, 4, 25, 100 → sum = 154 (N = 4)
  3. MSE = 154 / 4 = 38.5
  4. PSNR = 10·log10(65025 / 38.5) = 10·log10(1688.96)
  5. PSNR = 32.28 dB → band: Good

Identical signals (edge case)

Original = Compressed → no distortion

  1. Every difference is 0 → sum of squares = 0
  2. MSE = 0 / N = 0
  3. MAX² / MSE divides by zero → mathematically infinite
  4. PSNR = ∞ dB → band: Identical (lossless)

Frequently asked questions

Sources & references

The PSNR formula and the MAX = 2bits − 1 convention on this page were last cross-checked against the scikit-image and MATLAB references on 2026-06-20. The quality bands are explicitly labelled as heuristics, not a standard.

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a bug, edge case, or want to suggest an improvement?

Email me at [email protected] — most fixes ship within 24 hours.