Mean Square Displacement: Formula and Examples

By Dr. Zubair Khalid, DVM, MS, PhD ·

Mean Square Displacement: Formula and Examples

Mean square displacement (MSD) is the average squared distance a particle moves from its starting position over a defined time interval. It is written as MSD(τ) = ⟨|r(t+τ) - r(t)|²⟩, where r is the particle position, τ is the lag time, and the angle brackets mean an average over many starting times or many particles.

That single expression is the workhorse of single-particle tracking. It converts a messy set of recorded positions into a curve whose shape tells you whether a particle is diffusing freely, being pushed in one direction, or trapped in a cage. The slope of that curve gives the diffusion coefficient, one of the most useful numbers in cell biology, soft matter physics, and drug delivery research.

What the MSD Formula Actually Says

The formula has four parts, and each one matters.

r(t) is the position vector of the particle at time t. In two dimensions it has two components, x and y. In three dimensions it has three, x, y, and z. Position is measured in micrometers (µm) or nanometers (nm) in most microscopy work.

r(t+τ) is the position of the same particle at a later time, exactly τ seconds after t. The difference r(t+τ) - r(t) is the displacement vector over that lag time.

|r(t+τ) - r(t)|² is the squared length of that displacement vector. Squaring removes the sign, so a step to the left counts the same as a step to the right. This is why MSD never decreases as lag time grows, at least in theory.

⟨ ⟩ is the ensemble or time average. In practice you compute it by taking every possible pair of positions separated by τ in your trajectory, squaring each displacement, and averaging the results.

Because displacement is squared, MSD carries units of length squared: µm², nm², or cm². If you see a diffusion coefficient quoted in µm²/s, you are looking at the slope of an MSD curve divided by the appropriate dimensional factor.

Ensemble MSD versus time-averaged MSD

There are two ways to compute the average, and they are not always equivalent.

Ensemble MSD averages over many particles at the same absolute time. You track 200 beads, measure how far each has moved after 1 second, and average the squared displacements. This is the textbook definition.

Time-averaged MSD (TAMSD) averages over lag times within a single long trajectory. You track one particle for 10 minutes and slide a window of width τ along the recording. This is what most single-particle tracking experiments actually produce, because tracking hundreds of identical particles is often impractical inside a living cell [1].

For simple Brownian motion in a uniform medium, the two averages converge. For heterogeneous or switching systems, they can diverge sharply. A study of two-state switching diffusion showed that when the trajectory duration is comparable to or shorter than the residence time in each state, individual TAMSD curves spread widely and a single trajectory stops being representative of the ensemble [2]. That is a real problem when you are trying to report one diffusion coefficient per cell.

Why MSD Matters

MSD is the bridge between raw tracking data and physical meaning. A microscope camera gives you a list of coordinates. MSD turns that list into a statement about the environment the particle experienced.

Three practical uses dominate the literature.

Measuring diffusion coefficients. The slope of MSD versus lag time yields D, the diffusion coefficient. This is used to characterize mucus penetration by drug nanocarriers, membrane protein mobility, and polymer dynamics [3][4].

Classifying motion type. The shape of the MSD curve distinguishes free diffusion from directed transport from confined or anomalous motion. In a study of cholera toxin bound to GM1 on live cell membranes, image MSD analysis separated different modes of diffusion that would have looked identical in a single snapshot [5].

Probing material properties. Passive microrheology uses the MSD of embedded probe particles to extract the viscoelastic moduli of the surrounding fluid, without a rheometer [6]. In carrageenan gels, MSD curves revealed that kappa carrageenan traps particles in a permanent network while iota carrageenan allows diffusion even below the gelling temperature [4].

The Diffusion Equation: MSD = 2nDτ

For normal (Brownian) diffusion in n dimensions, the MSD grows linearly with lag time:

MSD(τ) = 2nDτ

Here n is the number of dimensions the particle can move in, D is the diffusion coefficient, and τ is the lag time.

  • In 2D (n = 2): MSD(τ) = 4Dτ
  • In 3D (n = 3): MSD(τ) = 6Dτ
  • In 1D (n = 1): MSD(τ) = 2Dτ

The factor of 2n comes from the mathematics of random walks. Each spatial dimension contributes independently to the variance of position, and each contributes 2Dτ.

Worked example: extracting D from a 2D MSD curve

Suppose you track a fluorescent bead diffusing on a lipid bilayer. You compute MSD at a series of lag times and fit a straight line to the early, linear portion of the curve. The slope of that line is 0.5 µm²/s.

Because the motion is two-dimensional, use MSD = 4Dτ.

Slope = 4D

D = slope / 4 = 0.5 µm²/s / 4 = 0.125 µm²/s

That is the answer. A bead with D = 0.125 µm²/s moves, on average, about 0.7 µm in one second in each dimension combined. To sanity-check the magnitude, plug τ = 1 s back in: MSD = 4 × 0.125 × 1 = 0.5 µm². The root-mean-square displacement is √0.5 ≈ 0.71 µm.

If the same slope had come from a 3D experiment, you would divide by 6 instead: D = 0.5 / 6 ≈ 0.083 µm²/s. Getting the dimensionality wrong inflates or deflates D by 50 percent, which is why you should always state n explicitly.

Why the slope, not a single point

You could in principle compute D from one lag time. Do not. A single MSD point carries the full noise of the trajectory. Fitting a line over a range of lag times averages that noise down and lets you check whether the relationship is actually linear. If it is not linear, the diffusion model is wrong and the slope is meaningless.

Reading the Log-Log Plot: Ballistic, Normal, and Anomalous

The most informative way to display MSD is a log-log plot: log(MSD) on the y-axis, log(τ) on the x-axis. On this plot, a power law MSD = Kτ^α becomes a straight line with slope α.

The exponent α is the single most diagnostic number in MSD analysis.

Regimeα (log-log slope)MSD behaviorPhysical interpretation
Ballisticα = 2MSD ∝ τ²Directed motion, active transport, motor-driven cargo
Normal diffusionα = 1MSD ∝ τFree Brownian motion, slope gives D
Anomalous subdiffusionα < 1MSD ∝ τ^αCrowding, binding, viscoelastic trapping, confined motion
Anomalous superdiffusion1 < α < 2MSD ∝ τ^αMixed directed and random motion, Lévy flights
Confinedα → 0 at long τMSD plateausParticle trapped in a bounded region

Ballistic motion (α = 2)

A particle moving at constant velocity v has displacement vτ, so MSD = v²τ². On a log-log plot the slope is 2. This is what you see for cargo carried by molecular motors along a microtubule, or for a particle in a flowing fluid. The signature is a steep line that doubles the slope of normal diffusion.

Normal diffusion (α = 1)

Free Brownian motion gives a slope of exactly 1 on a log-log plot. This is the reference case. Any deviation from slope 1 is information about the environment.

Anomalous subdiffusion (α < 1)

When a particle is slowed by obstacles, transient binding, or a viscoelastic medium, MSD grows more slowly than linearly. The slope drops below 1. Subdiffusion is extremely common in living cells, where the cytoplasm is crowded with proteins, organelles, and cytoskeletal filaments. A theoretical treatment of subdiffusion in a trapping potential showed that the MSD shape depends on the balance between the memory kernel of the medium and the strength of the trap, with distinct short-, intermediate-, and long-time behaviors [7].

Confined motion

If a particle is enclosed in a region of size L, MSD rises initially and then plateaus near L². The log-log slope starts near 1 and falls toward 0 at long lag times. This pattern appears for particles trapped in gel networks, inside vesicles, or between membrane compartments.

A caution about the exponent

The exponent α is often reported to two decimal places. That precision is usually not justified. Fitting α from a noisy MSD curve is sensitive to the range of lag times you choose, the number of points in the fit, and the presence of localization error [8][9]. A study of fitting guidelines for anomalous diffusion found that in some experimental conditions the time-averaged MSD should not be used as an estimator at all [8]. Report α with an honest uncertainty and state the fitting range.

How to Compute and Plot MSD: Step by Step

This is the practical workflow for a 2D single-particle tracking experiment.

  1. Record the trajectory. Extract (x, y) coordinates for each frame, with a known frame interval Δt. Store the trajectory as an ordered array of positions.
  1. Choose lag times. Lag time τ = mΔt, where m is an integer number of frames. Typical choices are m = 1, 2, 3, ... up to about one quarter of the total trajectory length.
  1. Compute squared displacements. For each lag m, take every pair of positions separated by m frames, compute (Δx² + Δy²), and average. This gives one MSD value per lag time.
  1. Plot MSD versus τ. Start with a linear plot to see the overall shape. Then switch to log-log to read the exponent.
  1. Fit the linear region. For normal diffusion, fit MSD = 4Dτ to the early lag times where the curve is straight. The slope divided by 4 gives D in 2D.
  1. Check the residuals. If the fit line systematically misses the data, the motion is not simple diffusion. Try MSD = 4Dτ^α and inspect α.
  1. Report D, α, the fitting range, and the number of trajectories. All four are needed for anyone to reproduce or compare your result.

How many fitting points?

This is one of the most common sources of error. Using too few points makes the fit noisy. Using too many points pulls in the curved tail of the MSD, which biases D downward. A study of how the number of fitting points influences the experimentally determined particle size distribution found that the choice materially changes the result [9]. A separate analysis of Brownian motion with localization error concluded that a simple unweighted least-squares fit can give the best estimate of D, provided an optimal number of MSD points is used [10].

The practical rule: fit the first 10 to 25 percent of the lag times, verify linearity by eye on the log-log plot, and report how many points you used. Newer work has shown that generalized least-squares fitting substantially reduces variance and bias for short and ultra-short trajectories, which matters when photobleaching limits you to about 100 frames or fewer [11].

Common Mistakes and Limitations

Lag-time choice changes your answer

There is no universal correct lag time. Short lags are dominated by localization error. Long lags are dominated by drift and by the finite length of the trajectory. The linear region in between is your usable window. If you fit the whole curve, you are averaging over regimes that do not share a single D.

Drift masquerades as superdiffusion

Stage drift, fluid flow, or active transport adds a directed component to every trajectory. On a log-log plot, drift inflates the slope at long lag times and can push an apparently normal diffusing particle toward α > 1. Always check for drift by tracking immobile fiducial markers on the same coverslip, and subtract the drift before computing MSD.

Localization error adds a constant offset

Every position estimate carries uncertainty from photon noise, camera pixel size, and fitting error. That uncertainty adds a positive constant to the MSD at every lag time. The result is an MSD curve that does not pass through the origin and that bends upward at short lags. Michalet's analysis showed that this offset systematically biases D unless handled correctly, and that the bias depends on how many MSD points you fit [10]. Localization imprecision also creates spurious anti-directional motion that can be mistaken for real back-and-forth movement [12].

The practical fix: estimate your localization error independently (for example from immobilized particles), and either fit MSD = 4Dτ + 2σ² (in 2D, where σ is the localization uncertainty) or exclude the shortest lag times from the fit.

Time-averaged MSD can fail in heterogeneous systems

In a cell, a particle may switch between a fast state and a slow state. If the trajectory is shorter than the typical residence time in each state, the TAMSD from a single trajectory is not representative, and the spread across trajectories is large [2]. Averaging many short trajectories does not fix this, because the underlying process is not ergodic over the measurement window. This is why some studies report a distribution of D values rather than a single number.

R² alone is a poor fit criterion

A high R² does not prove that the diffusion model is correct. A study of oral lipid nanocarriers showed that relying on R² alone can overestimate the diffusion capacity of particles, and recommended combining R² with additional statistical parameters [3]. Always inspect the residuals and the log-log slope.

MSD hides heterogeneity

Two particles with completely different motion patterns can produce identical MSD curves if their displacements happen to average out the same way. MSD is a second-order statistic, so it discards information about direction, velocity, and the shape of the displacement distribution. Recent reviews emphasize that methods based on angles, velocities, and dwell times are more sensitive to transient and heterogeneous behavior than MSD alone [1]. Machine learning approaches are now used to classify trajectories from 3D tracking data where MSD classification struggles with mixed motion types [13].

Dimensionality errors

Confusing 2D and 3D formulas is a silent, common mistake. If your particle moves in a thin slab but you use the 3D formula, you will underestimate D by a factor of 1.5. If your particle moves in 3D but you use the 2D formula, you will overestimate D by the same factor. State n explicitly in every report.

MSD in Practice: Where It Is Used

Cell biology. Tracking receptors, vesicles, and viral particles on and inside cells. MSD distinguishes free diffusion from binding, confinement, and active transport.

Drug delivery. Characterizing how nanocarriers move through intestinal mucus. MSD analysis gives both D and the anomalous exponent α, which together describe how well a carrier penetrates the mucus barrier [3].

Soft matter and food science. Multiple particle tracking revealed the network structure of kappa and iota carrageenan gels. MSD curves showed that kappa carrageenan traps probe particles in a rigid network on cooling, while iota carrageenan allows continued diffusion, explaining the weak-gel behavior [4].

Microrheology. Passive microrheology extracts the complex viscosity of a fluid from the MSD of embedded probe particles as a function of lag time. A method based on the displacement probability density function achieved under 1 percent error in these measurements, roughly half the error of tracking-based approaches [6].

Polymer physics. MSD tensors can detect fluctuating diffusivity in polymer models, separating the Rouse, Zimm, reptation, and rigid-rod behaviors that simpler MSD parameters cannot distinguish [14].

Granular and complex fluids. MSD of tracer particles in cooling granular mixtures shows a logarithmic time dependence rather than a power law, a signature of the decaying granular temperature [15].

Quick Review

  • MSD(τ) = ⟨|r(t+τ) - r(t)|²⟩, with units of length squared.
  • For normal diffusion in n dimensions, MSD = 2nDτ. In 2D this is 4Dτ, in 3D it is 6Dτ.
  • The slope of MSD versus τ gives D. A 2D slope of 0.5 µm²/s means D = 0.125 µm²/s.
  • On a log-log plot, the slope is the exponent α. Ballistic is 2, normal diffusion is 1, subdiffusion is below 1, confined motion plateaus.
  • Fit only the linear region, typically the first 10 to 25 percent of lag times, and report how many points you used.
  • Localization error adds a constant offset that biases D. Drift inflates the slope at long lags. Both must be checked.
  • Time-averaged MSD can fail in heterogeneous or switching systems, especially with short trajectories.

Frequently Asked Questions

What are the units of mean square displacement?

MSD has units of length squared, such as µm², nm², or cm². The diffusion coefficient extracted from its slope has units of length squared per time, such as µm²/s.

What is the difference between MSD and RMSD?

MSD is the average of squared displacements. RMSD is the square root of MSD, so it has units of length. RMSD is easier to picture, but MSD is the quantity that grows linearly with time for Brownian motion.

How do I get the diffusion coefficient from an MSD curve?

Fit a straight line to the linear portion of MSD versus lag time. In 2D, divide the slope by 4. In 3D, divide by 6. In 1D, divide by 2.

Why is my MSD curve not linear?

Nonlinearity means the motion is not simple Brownian diffusion. A steep upward curve suggests directed motion or drift. A curve that flattens suggests confinement. A gentle upward curve suggests anomalous subdiffusion from crowding or binding.

What does a log-log slope of 2 mean?

A log-log slope of 2 means ballistic motion, where MSD grows as τ². This is the signature of active transport, such as motor proteins carrying cargo along a filament.

Can MSD be negative?

No. MSD is an average of squared displacements, so every term is zero or positive. A negative MSD value in your output means there is a bug in the code or the data.

Related Articles

Sources

  1. Trajectory Analysis in Single-Particle Tracking: From Mean Squared Displacement to Machine Learning Approaches.
  2. Time-averaged mean square displacement for switching diffusion.
  3. Taking Particle Tracking into Practice by Novel Software and Screening Approach: Case-Study of Oral Lipid Nanocarriers
  4. Network structure and gelation mechanism of kappa and iota carrageenan elucidated by multiple particle tracking
  5. Modes of diffusion of cholera toxin bound to GM1 on live cell membrane by image mean square displacement analysis.
  6. Particle Image micro-Rheology (PIR) using displacement probability density function
  7. Subdiffusive behavior in a trapping potential: mean square displacement and velocity autocorrelation function.
  8. Guidelines for the Fitting of Anomalous Diffusion Mean Square Displacement Graphs from Single Particle Tracking Experiments
  9. How the number of fitting points for the slope of the mean-square displacement influences the experimentally determined particle size distribution from single-particle tracking.
  10. Mean Square Displacement Analysis of Single-Particle Trajectories with Localization Error: Brownian Motion in Isotropic Medium
  11. Improved mean squared displacement analysis for anomalous single-particle trajectories.
  12. The effect of localisation imprecision on quantification of the directionality of motion for single particle tracking applications.
  13. Feature Selection and Hyperparameter Optimization for Machine Learned Classification of 3D Single-Particle Tracking
  14. Elucidating fluctuating diffusivity in center-of-mass motion of polymer models with time-averaged mean-square-displacement tensor.
  15. Mean square displacement of intruders in freely cooling multicomponent granular mixtures.