Electrophoresis DNA Ladder Band Size Estimator

Estimate band sizes from gel image using ladder migration distances

Estimate DNA fragment sizes from a gel by entering ladder band sizes and migration distances, then unknown band distances. Uses semi-log linear interpolation to size PCR products and restriction fragments. For molecular biologists. Runs in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

Why is DNA migration semi-logarithmic?

In agarose gel electrophoresis the distance a fragment travels is roughly proportional to the logarithm of its size, not its size directly. Small fragments move much faster, so plotting log size against distance gives an approximately straight line that can be interpolated.

When you run DNA on an agarose gel beside a molecular weight ladder, you can read off approximate fragment sizes by comparing how far each band travelled. This tool turns that visual comparison into a number by fitting the well-known semi-logarithmic relationship between fragment size and migration distance.

How it works

Across most of a gel’s range the migration distance of a fragment is linearly related to the logarithm of its size:

distance is approximately proportional to log10(size)

For each unknown band, the tool finds the two ladder bands whose distances bracket it, then interpolates on the log scale:

log10(size) = log10(s1) + (d - d1) / (d2 - d1) x (log10(s2) - log10(s1))
size        = 10 ^ log10(size)

Here d1 and d2 are the bracketing ladder distances with sizes s1 and s2, and d is the unknown band’s distance.

Worked example

Suppose you run a 1% agarose gel with a 1 kb DNA ladder alongside a PCR product. Using a ruler on a printed gel image, you measure these ladder band positions from the top edge of the well:

Ladder band (bp)Distance from well (mm)
3,00022
1,50031
1,00037
50052

Your unknown PCR band sits at 34 mm. It falls between the 1,500 bp band (31 mm) and the 1,000 bp band (37 mm). Interpolating on the log scale:

log10(size) = log10(1500) + (34 − 31) / (37 − 31) × (log10(1000) − log10(1500))
            = 3.176 + 0.5 × (3.000 − 3.176)
            = 3.176 − 0.088
            = 3.088
size        = 10^3.088 ≈ 1,224 bp

So the fragment is approximately 1,200 bp. This is consistent with a PCR product designed to amplify a 1.2 kb region. If your expected product was 800 bp, you would instead suspect a non-specific amplification product.

Getting accurate measurements from gel images

The most common source of error in band sizing is inconsistent measurement. Use these practices for the best results:

  • Measure from the same reference edge. Always measure from the bottom edge of the well to the top edge of each band, or always to the center — what matters is consistency.
  • Use pixel coordinates in image software. Rather than a physical ruler, load the gel photo into ImageJ or similar and use the measurement tool for pixel distances. This avoids parallax and image distortion.
  • Straighten the gel image first. Even slight tilts introduce systematic errors, especially for bands near the edges of the gel.
  • Do not compare across different gel runs. Ladder and samples must be on the same gel; migration depends on agarose percentage, buffer, and run conditions, which differ between gels.

Choosing the right agarose percentage

Gel percentage determines the size range you can resolve well:

Agarose %Resolves well
0.5–0.8%Large fragments 5–50 kb
1%0.5–10 kb (most routine PCR)
1.5–2%Small fragments 100–1,500 bp
3%Very small fragments below 500 bp

Choose a gel percentage that puts your expected fragment size in the middle of the ladder range — this is where the semi-log fit is most linear and your size estimate is most accurate. Bands near the top or bottom of the ladder’s range have the largest interpolation error.