N-Body Simulator

N-Body Simulator

An interactive 2D gravity simulator: planets, binary stars, asteroid belts and colliding galaxies with real physics.

Runs in your browser – nothing to install.

Developer
Bugfish
Released
May 23, 2026
Version
1.0

About this tool

Watch gravity at work. The simulator integrates every body with the velocity Verlet method in real SI units, so orbits behave the way they do in space.

Start from a preset – the Solar System, a binary star, the figure-8 three-body orbit, two merging galaxies, Lagrange points L4/L5 or an asteroid belt – or double-click the canvas to add your own bodies and set mass, position and velocity, or let the tool calculate a circular orbit for you.

Control speed, time step, softening and even the gravitational constant, run time backwards, follow a body or the centre of mass and switch on trails, velocity and acceleration vectors, labels and a grid. Units in metres, AU, light years or parsecs and in kg, solar or Earth masses. The diagnostics panel tracks energy drift and momentum.

Export a simulation as JSON and import it again, or keep it in this browser.

Comments

Log in to write a comment or reply. A moderator checks every comment before it appears – for security and to keep spam and abuse out.

No comments yet.