Random Walk & Markov Chain Visualizer

Run random walk and Markov chain simulations in-browser, compare trajectories and probability evolution, and share or export results quickly.

Runs locally in your browser. Inputs are not uploaded. This tool is for learning/visualization (not a prediction or security guarantee).

Other languages 日本語 | English | 简体中文 | 繁體中文 | 繁體中文(香港) | Español | Português (Brasil) | Bahasa Indonesia | 한국어 | Français | हिन्दी | العربية

Why this stochastic process visualizer?

How to use (3 steps)

  1. Choose a mode: Random Walk or Markov Chain.
  2. Adjust settings (steps, paths, or transition matrix).
  3. Run, then download or copy a settings-only URL.

Visualize

Random walk & Markov chain

Two lightweight modes: random-walk trajectories/MSD and Markov probability evolution/graphs.

For 1D, this becomes p(right). For 2D, it biases the direction softly.

0°
Advanced

Visualization

Trajectories

MSD

Distribution

Probability table (sample)

Details

Notes

These visualizations help build intuition. They do not guarantee prediction accuracy or cryptographic security.

Random walk and Markov chain workflow

Use this visualizer to compare one-dimensional random walks, finite-state Markov chains, transition matrices, and stationary behavior with a reproducible seed.

How it works

Random-walk mode simulates step paths from the chosen probability and seed. Markov-chain mode advances a state vector through the transition matrix, then shows how mass moves over time.

When to use

Use it to teach stochastic processes, test a transition matrix, explain absorbing states, or compare how quickly different chains approach their long-run distribution.

Common mistakes to avoid

Review workflow

Choose the model type, validate the probability inputs, run with a fixed seed, then compare the path plot, state probabilities, and stationary estimate before sharing conclusions.

See also

Frequently asked questions

What is a random walk?
A random walk is a process that moves step-by-step in random directions. It is a basic model for diffusion and noise.
What is a Markov chain?
A Markov chain is a process where the next state depends only on the current state, via a transition matrix.
Does a stationary distribution always converge?
Not always. Periodic or reducible chains may not converge from every initial distribution, even if a stationary distribution exists.
Is my input uploaded?
No. Everything runs locally in your browser.
What should I check before running a Markov chain?

Make sure every transition row is non-negative and sums to 1. Otherwise the state probabilities will not describe a valid chain.

Why does the starting state matter?

The starting state or distribution controls the early steps. A well-behaved chain may converge later, but short horizons can still depend heavily on the start.

How to read the visualizer

Model type first

Random walks highlight sample paths and spread over repeated steps. Markov chains highlight probability mass moving between named states.

Matrix validation

For a Markov chain, each row is one current state and each cell is the probability of moving to the next state. Rows should sum to 1 after rounding.

Convergence checks

Absorbing, reducible, or periodic chains may not behave like a simple converging example. Compare several horizons before describing long-run behavior.

When to rerun

Rerun with the same seed when checking probability changes. Change the seed only when you want to illustrate simulation variability.

Related tools

Related calculators