Anticode Open builder

Turn the formula you use with customers into a calculator anyone can try

If you keep doing the same sum for customers (paint needed for a room, feed for a herd, the size of a solar array), that sum can be a calculator on your site. The hard part isn't the arithmetic. It's choosing inputs people can answer, rejecting nonsense politely and showing the working. Here's how to get those right with Anticode as your custom calculator builder.

Updated · By the Anticode team

Start from the sum on paper

Write the calculation out the way you'd explain it to a new colleague: what you ask, what you look up, what you multiply, where you round. Include the constants (coverage per litre, a safety margin, a tax rate you apply) with their units. Then work three real examples through by hand, including one awkward case. Those examples become your test: when the calculator is built, type them in and compare.

Most formulas that live in someone's head have hidden steps. A decorator's "paint for a room" quietly subtracts doors and windows, adds a second coat and rounds up to whole tins. If you don't write those steps down, the calculator will be cleaner than your real answer and wrong in ways customers notice.

Inputs people can actually answer

Turning expert inputs into visitor-friendly ones
What the formula needsWhat to ask instead
Wall area in square metresRoom length, width and height, plus number of doors and windows
Roof pitch in degreesThree pictured options: shallow, medium, steep
Annual consumption in kWhHousehold size, with an option to type the figure from a bill
Dry matter intakeAnimal type and weight band

Give every field a unit next to it, a sensible default where one exists, and an example in the hint text ("e.g. 3.4"). Use number fields that bring up a numeric keyboard on phones, and sliders only where a rough value is fine.

Validation that helps instead of scolding

  • Check ranges, not just types. A ceiling of 40 metres is a number, but it isn't a room. Set plausible minimums and maximums and explain them.
  • Say what to fix, beside the field. "Height should be between 2 and 6 metres" beats a red outline.
  • Accept the ways people type. Commas as thousands separators, a trailing unit, a leading space.
  • Recalculate as they type, but don't show an error until they've left the field.
  • Never show NaN or Infinity. A divide-by-zero case should produce a message, not a broken number.

Showing the result and the working

Lead with the answer in a large figure, rounded the way the customer will use it: whole tins, whole panels, the nearest ten pounds. Underneath, a breakdown table shows each step with its value, so a sceptical reader can follow the logic and an expert can spot a wrong constant. State the assumptions in a sentence and, where the stakes are real, add that the result is an estimate.

Some calculators benefit from a comparison view (two options side by side) or a small chart, such as cost over ten years. Ask for these specifically if they matter; they're easy to add later as a change request too.

Building it with Anticode

Paste your formula, constants and worked examples into the request, for example: "A paint calculator for a decorating shop. Inputs: room length, width, height, doors, windows, coats. Subtract 1.9 m² per door and 1.5 m² per window, 12 m² per litre, round up to 2.5-litre tins. Show tins needed and a breakdown. Then offer a form to reserve the paint." The Architect turns that into a plan and asks about anything that changes the build. The model then writes the calculator as one self-contained app, with the logic, validation and layout in a single file, and you can try your three examples straight away in the preview.

If you'd like a lead at the end, an enquiry form in the app sends the visitor's details with their inputs and result to you by email and in the dashboard. For pricing calculators specifically, the quote calculator page goes further into ranges and disclaimers.

When the maths should run on the server

The calculator runs in the visitor's browser, so the formula and constants are visible to anyone who reads the page source, and a visitor could alter a result before submitting it. That's fine for public, rule-of-thumb sums. It isn't fine when the formula is commercially sensitive or when you'll act on the submitted figure.

For those cases, keep the visible calculator as a guide and check the figure on the server with a site function. The app's enquiry sends through the built-in contact form, and a function attached to that form runs for it too; the app's extra answers arrive as lines in the message, so recalculating them means a signed HTTPS call to your own endpoint, where your private logic runs, and whether the app shows the function's message depends on the app, so ask for it and test it. The other route is a custom form on a site page, where a formula function recalculates from the submitted fields on Anticode's server (arithmetic over form fields). Anticode never runs your own code itself. See formula functions.

Limits

  • No live inputs: exchange rates, energy tariffs or stock prices can't be fetched, so constants are whatever you set and update.
  • No saved history for visitors beyond their own browser, and no visitor accounts.
  • The result isn't checked by anyone: test your worked examples after every change.

Questions people ask

Can I embed the calculator in my existing site?

Anticode publishes the calculator as its own site at an anticode.dev address or your domain on paid plans, which you can link to. You can also export it as one self-contained HTML file and host it yourself.

Can a custom calculator builder handle conditional logic?

Yes. If one answer changes which questions appear or which rate applies, describe the rule and the app implements it. Spell out every branch to be safe.

Can I hide my formula?

Not in the browser. Put the sensitive part in a site function that runs on submission, and show visitors only an approximate guide.