Random Walk Simulator
Simulate a random walk — a path built from repeated random steps — and watch it wander across the plot, a simple visual introduction to stochastic processes.
Generate
How the Random Walk Simulator works
A random walk is one of the simplest stochastic processes in mathematics: starting from a point, each step moves in a random direction chosen independently of all previous steps. Despite that simplicity, random walks model a surprising range of real phenomena, from the diffusion of particles suspended in fluid (Brownian motion) to stock price movements and animal foraging paths.
This simulation takes one of four equally likely directions at each step (up, down, left, right), tracing the resulting path as an SVG line — run it a few times with the same step count and notice how differently each path wanders, despite following identical rules.
How to use it
Frequently asked questions
Does a random walk always end up far from the start?
Not necessarily — because steps are independent and equally likely in every direction, the walk can wander far away, loop back near the start, or anything in between; the expected distance from the origin grows with the square root of the number of steps, not proportionally to it.
What's a real-world use of random walk models?
Random walks are used to model stock price fluctuations, particle diffusion, and even certain search algorithms and animal movement patterns.
Why does the path sometimes look tangled in one area?
Since each step is independent of position, a walk can revisit nearby areas repeatedly by chance, especially over many steps — that clustering is a genuine, expected feature of random walks, not a display error.