Help & Documentation

How can we help?

Explore VarCalc features and learn how to master complex calculations with ease.

Mathematical Functions

VarCalc supports a comprehensive collection of mathematical operations.

Category Functions Description
Basic arithmetic + - * / ^ (**) pow(a,b) sqrt(x) cbrt(x) root(x,n) hypot(a,b,...) Addition, subtraction, multiplication, division, powers/roots, and hypotenuse (hypot).
Trigonometry sin cos tan asin acos atan atan2 sec csc cot rad(deg) deg(rad) Angle functions (defaults to radians). rad converts degrees to radians; deg converts radians to degrees.
Hyperbolic sinh cosh tanh Hyperbolic functions.
Logarithms log(x) ln(x) log10(x) log2(x) logBase(x,b) exp(x) Natural logarithm, base 10, base 2, arbitrary base, and exponential function.
Rounding & integers round(x,d) floor(x) ceil(x) trunc(x) ceilMag(x) floorMag(x) abs(x) mod(a,b) gcd(a,b) lcm(a,b) Rounding (d=decimal places), floor, ceil, truncation, magnitude rounding (ceilMag/floorMag), absolute value, modulo, GCD, LCM.
Statistics sum(...) avg(...) median(...) min(...) max(...) stddev(...) Sum, average, median, minimum, maximum, and standard deviation of a list of values.
Random & sign random() randint(min,max) sign(x) Random numbers (0..1), random integer inclusive, sign (-1/0/1).
Combinatorics fact(n) or n!, nCr(n,r), nPr(n,r) Factorial, combinations (binomial coefficient), and permutations.
Finance pmt(rate,nper,pv,fv,type) fv(...) Payment (annuity) and future value.
Time days(d) hours(h) minutes(m) time(h,m,s) timelcl() timeutc() betweentime(val,min,max) Converts days/hours/minutes to seconds; creates times as seconds; local/UTC time; time range (also across midnight).
Utility clamp(x,min,max) lerp(a,b,t) map(x,in_min,in_max,out_min,out_max) map(x,x1,x2,...,y1,y2,...) mapxy(x,x1,y1,x2,y2,...) smoothstep(edge0,edge1,x) Clamp values, linear interpolation, map ranges, smooth transition (smoothstep).
Constants PI pi E e Pi (3.1415...) and Euler's number e (2.718...). Upper/lower case is supported.

Logical & Control Functions

These functions enable complex conditions and decisions within your formulas.

Function Description Example
if(cond, trueVal, falseVal) If cond is true, return trueVal; otherwise return falseVal. (Alias: iff) if(x > 10, 100, 0)
ifList(x, c1, v1, c2, v2, ..., else) Checks x against conditions in order and returns the corresponding value. Conditions can be written as a prefix (e.g. <3, <=4, >10, ==2, !=0). The last parameter else is optional; if no match is found and else is missing, NaN is returned. ifList(x, <3, 1000, <4, 2000, 3000)
and(...) / or(...) / not(x) Logical AND (all true), OR (any true), NOT. and(x>0, y<5)
switchCase(key, c1, v1, c2, v2, ..., def) Compares key with c1, c2... and returns the corresponding value (comparison via ==). Note: string literals ("...") are not supported in formulas — use numbers/booleans. switchCase(x, 1, 10, 2, 20, 0)
choose(index, val1, val2, ...) Selects the value at position index (1-based). choose(2, 10, 20, 30) -> 20
between(x, min, max) Checks whether x is between min and max (inclusive). between(5, 1, 10) -> 1
anyOf(x, val1, val2, ...) Checks whether x matches any of the provided values. anyOf(x, 1, 3, 5)
isNaN(x) Checks whether x is NaN (not a valid number). if(isNaN(WeightMax), 1, 2)
isFinite(x) Checks whether x is a finite number (neither NaN nor ±Infinity). isFinite(1/0) -> false
isInfinite(x) Checks whether x is ±Infinity. isInfinite(1/0) -> true
isInvalid(x) Checks whether x is invalid (null/undefined/NaNInfinity). if(isInvalid(x), 0, x)
coalesce(v1, v2, ...) Returns the first valid value (not null/undefined/NaN). If none are valid, 0 is used. coalesce(null, 0/0, 5) -> 5
nvl(val, fallback) If val is invalid, return fallback. nvl(x, 0)
onerror(val, fallback) Catches calculation errors (e.g. division by zero). onerror(1/0, 999) -> 999
Operators In addition to function calls, VarCalc also supports operators: == != < <= > >= as well as && || !. Convenient: <> is treated as !=, and a single = is interpreted as ==. Additionally, & is supported as an alias for && and | as an alias for ||. Note: In VarCalc, NaN == NaN (or NaN = NaN) is treated as true. In JavaScript this is usually always false — use isNaN(x) or isInvalid(x) explicitly when needed. if(x = 1 && not(y), 1, 0)

Tips & Tricks

  • Formula suggestions (inline): In formula fields you can open suggestions (variables + functions) with Ctrl+Space. Navigate with /, insert with Enter/Tab, close with Esc. The docs panel shows a short description and an example for the selected item.
  • Use sliders: Enable the "Slider" in variable settings to quickly explore values.
  • Offline mode: Install VarCalc as an app (PWA) via your browser menu ("Add to Home Screen"). You can calculate without an internet connection.
  • Folders (Premium): Organize your calculators in folders and subfolders for better overview.
  • Drag & Drop: In edit mode you can change the variable order via drag & drop.
  • Percent: 10% is automatically interpreted as 10/100.
  • Time literals: 01:30 or 01:30:15 is automatically converted to seconds.

Value Sync (Supporters)

By default, sync only merges calculator structure (variables, formulas, folders). As a Supporter you can optionally sync the current variable values per calculator.

  • Per calculator: Value sync is enabled per calculator (you decide where current values should sync).
  • Enable: Open a calculator and click the Value sync icon (Supporters).
  • Multiple devices: When enabled, the current values of this calculator are synced across your devices (instead of only structure/default values).
  • Privacy: Values are never shared with other users via share/export. Share/export still contains only structure and default values.
  • Default: Value sync is off by default and must be enabled per calculator.

Sharing with Share Groups (Premium)

Share groups help you share calculators with specific people (e.g. team, class, client) instead of publishing them publicly for everyone.

  • Create a share group: Open your profile and create a new share group.
  • Add members: Enter email addresses. Handy for teams: patterns like *@company.com are supported.
  • Select when sharing: Open the share dialog of a calculator and choose the desired group.

Frequently Asked Questions (FAQ)

Does VarCalc work offline?

Yes. VarCalc is a PWA and stores your data locally. Once you're back online, the structure is synchronized.

What gets synchronized?

By default, structure data is synced (calculators, variables, formulas, folders). Current variable values are only synced if you explicitly enable value sync per calculator (Supporters).

How do I enable value sync?

Open the desired calculator and click the icon. Value sync is configured per calculator and is off by default.

Are values included when sharing or exporting?

No. Share/export still contains only structure and default values. Current values remain private and are not shared with other users.

Can I export/import a calculator?

Yes — via export/import as a .varcalc file. Export is only available for Premium.

How do I rename a calculator?

Open the calculator, switch to edit mode (), then click the calculator title — type the new name and confirm with Enter.

How do I rename a folder?

Open the folder and click the folder title at the top. Then type and confirm with Enter.

How do I delete a folder?

In an opened folder you'll find a trash icon at the top to delete it. VarCalc asks for confirmation.

How do I reference other variables in formulas?

Write the variable name directly in the formula. VarCalc is case-sensitive.

Does the order of variables matter?

Usually not. VarCalc calculates variables automatically based on availability. In edit mode you can still reorder variables via drag & drop for better overview.

Why does it sometimes show “NaN”?

NaN means “not a valid number”. This can happen with invalid formulas or when a calculation has no defined value (e.g. 0/0). Note: In VarCalc, NaN == NaN (and NaN = NaN) is treated as true. For readable formulas we still recommend isNaN(x) or isInvalid(x).

Which decimal separator is supported?

Use a dot as the decimal separator in formulas and numeric values (e.g. 3.14). Percent (10%) and time literals (01:30) are also recognized.

Can I write percentages?

Yes. 10% is automatically interpreted as 10/100.

Can I enter times like 01:30?

Yes. 01:30 (or 01:30:15) is automatically interpreted as seconds (handy for time calculations).

Radians or degrees for trigonometry?

Trigonometric functions default to radians. Use rad(deg) and deg(rad) to convert.

Can I enable a slider for a variable?

Yes. In variable settings you can enable a slider to quickly try out values.

Can I hide variables?

Yes. Variables can be marked as “hidden” so only relevant inputs are visible.

Can I create variables as a dropdown (enum)?

Yes. Variables can have an enum/dropdown so users can select from predefined options.

Can I add separators/sections to a calculator?

Yes. There are variable types like “Separator” to visually structure a calculator.

How do I share a calculator with others?

In the folder view, open the dropdown on the calculator and select “Share”. With share groups (Premium) you can share with specific people/teams.

Where do I report bugs or send feedback?

Use the feedback/contact form on this page. The more detailed your description (and optionally logs/screenshots), the faster we can help.

Contact

Do you have more questions or need support? Send us a message.