Tool01
All tools

Free · local in your browser

RPG Damage Formula Sandbox

Type a damage or derived-stat formula such as STR*2 + WEAPON - DEF, set each variable with a slider, and read the result plus a sweep graph of one variable across its range. It uses the same published formula grammar as WriteIDE and works entirely in your browser.

Every name that is not one of the listed functions becomes a variable below. Names are case sensitive, so STR and str are two variables.

Variables
max
max
max
Sweep graph
varies
What the grammar accepts
Operators
+ - * / ^
Functions
floor ceil round abs sqrt min max
  • The result is floored to a whole number, the way LitRPG stats usually are.
  • This reads formulas, not dice. 2d6 is not part of the grammar.
  • The power operator groups right to left, so 2^3^2 is 512.
Result
29

Computed from the variable values on the left.

Result vs DEF
-18-5.5719.53208162432404850ResultDEF
Result as DEF varies from 0 to 50
DEFResult
032
131
230
329 (you are here)
428
527
626
725
824
923
1022
1121
1220
1319
1418
1517
1616
1715
1814
1913
2012
2111
2210
239
248
257
266
275
284
293
302
311
320
33-1
34-2
35-3
36-4
37-5
38-6
39-7
40-8
41-9
42-10
43-11
44-12
45-13
46-14
47-15
48-16
49-17
50-18

The gold marker sits where DEF equals its current value.

Share

The PNG holds the sweep graph, the formula, and the variable values, ready to post to Reddit or Discord.

How the sandbox reads a formula

The sandbox parses the same grammar WriteIDE validates for stat formulas: numbers, your own variable names, the operators plus, minus, times, divide, and power, parentheses, and the function whitelist floor, ceil, round, abs, sqrt, min, and max. Anything else, such as implicit multiplication like 2STR or a dice roll like 2d6, is rejected and the result reads as a dash. The final value is floored to a whole number, so STR times 2.5 with STR at 3 shows 7 rather than 7.5, since intermediate math stays a decimal and only the returned value floors.

Design combat math, not spreadsheets

A general graphing tool makes you rename your stats to x and y and gives you no sense of how a formula behaves as one stat scales. This sandbox keeps your real variable names, evaluates the formula with the same engine that runs across a whole WriteIDE manuscript, and draws the sweep so you can see the shape of the curve as defense climbs to 200 or strength doubles. It runs entirely in your browser. There is no account and nothing you type is sent anywhere.

Good to know

Questions about this tool

What formulas can I type?

Numbers, your own variable names, + - * / ^, parentheses, and the functions floor, ceil, round, min, max, abs, and sqrt. The power operator groups right to left, so 2^3^2 is 512.

Why is my result a whole number?

The result is floored, the way LitRPG stats usually are. Intermediate steps stay decimal, so a formula can show 7 where a hand calculation shows 7.5.

What is the sweep graph?

Pick one variable and it draws the result across a range you choose, with a marker at the variable's current value. Copy the sweep as a table or download the graph as a PNG.

What if the formula cannot be read?

The page says so and holds the last graph that worked until the formula parses again. Every name that is not a listed function becomes a variable with a slider.

Made with writeide.com
Browse all free tools