Open-source baseball simulation for everyone
Baseball Sim Engine is free and open source under the MIT License.
Anyone can use it, study it, modify it, or build something new with it. I want to keep it that way.
I rely on support from people who want to see the project continue. If you enjoy Baseball Sim Engine or believe in what I’m building, please consider supporting it.
Support the Project
Become a patron for $5 per month and help support continued development.
Or, if you’d rather make a one-time contribution, you can send support directly through PayPal.

This is a small project, so your support makes a real difference.
Where Does the Money Go?
Mostly toward giving me more time to work on Baseball Sim Engine.
There are also costs for servers, hosting, data processing, testing, and the infrastructure behind the project.
A lot of the work happens behind the scenes: running large simulation samples, comparing results against real baseball, improving player ratings, maintaining the historical data pipeline, fixing strange baseball edge cases, and keeping the project documented and usable.
About Baseball Sim Engine
I’m Patrick Toner, the developer behind Baseball Sim Engine.
I’ve always loved baseball games, particularly the idea of building a team and watching years of history accumulate around it. But I’ve also been frustrated by how temporary those worlds can be.
A new version comes out. A service shuts down. A project disappears. The save file, league history, and sometimes the game itself eventually get left behind.
Around 2020, I started building my own persistent online baseball game. As that project developed, the simulation itself became a bigger and bigger part of the work.
I wanted games to be more than a final score generated from a few ratings. I wanted a pitch to be a pitch, a ball in play to have a trajectory, a fielder to have to make a play, and a runner to have to decide whether to advance.
Eventually, I separated the simulation from the game and released it as its own open-source project.
That became Baseball Sim Engine.
An Engine, Not a Game
Baseball Sim Engine is the baseball layer underneath an application.
You provide the teams, players, lineups, pitchers, league environment, stadium environment, and random-number generator. The engine takes those inputs and plays the game.
It doesn’t provide accounts, contracts, schedules, franchise management, a user interface, or a particular baseball universe.
That separation is intentional.
The same engine can be used for a fictional league, a historical simulation, a prediction system, a research project, a browser game, or something I haven’t thought of.
Baseball, One Pitch at a Time
The engine advances a game exactly one pitch at a time.
A pitch can be taken, swung at, missed, fouled off, or put into play. Contact can produce different trajectories, exit velocities, launch angles, distances, and locations. From there, the defense has to resolve the play and the runners have to react.
Pitchers have repertoires, quality, stamina, handedness splits, and bullpen roles. Hitters have their own matchup-dependent abilities. Fielders and runners matter. Stadiums and league environments matter.
The objective isn’t to create complexity for its own sake. It’s to make the final result emerge from recognizable pieces of baseball.
A 5-3 groundout should exist because a pitch was thrown, the hitter put a ground ball in play, the third baseman fielded it, and the throw beat the runner — not simply because the simulation selected “groundout” from a table of final outcomes.
Built to Be Measured
Baseball is complicated, but it also gives us an enormous amount of data against which a simulation can be tested.
Baseball Sim Engine includes tools for building player ratings and simulation environments from historical MLB data. Large groups of simulated games can then be compared with real baseball across scoring, hitting, pitching, baserunning, swing behavior, contact rates, and batted-ball distributions.
The engine isn’t limited to reproducing modern MLB. The environment is configurable, so different leagues, seasons, eras, stadiums, or fictional worlds can behave differently.
The goal is to make those differences explicit and measurable instead of burying them inside the simulation.
Why Open Source?
I don’t want Baseball Sim Engine to depend on one game or one website continuing to exist.
The engine is released under the MIT License. The source code is public. You can inspect it, run it yourself, modify it, fork it, or use it as the foundation for another project.
If this website disappeared tomorrow, the engine would still exist.
And if someone has a better idea for how part of baseball should be modeled, they can experiment with it themselves.
That’s important to me.
Other Ways to Help
You don’t have to spend money to support Baseball Sim Engine.
Use the engine. Build something with it. Report a bug. Question a simulation assumption. Open an issue. Submit code. Share the project.
One of the main reasons for making Baseball Sim Engine open source is so that it can become more than something I use for my own baseball game.
View Baseball Sim Engine on GitHub
View Baseball Sim Engine on npm
Follow Development
I post development updates, simulation results, experiments, and other project news on X.
Follow Baseball Sim Engine on X
For questions, feedback, or other inquiries: