Dev.to WebDev πŸ›  Dev πŸ‘ 0 πŸ“– 3 min read

How I built 30 pricing calculators as plain static HTML (no framework, no backend)

Trade Pricing Control (https://tradepricingcontrol.com/) is a set of free calculators that help small home service businesses quote jobs: window cleaning, pressure washing, junk removal, house cleaning and about 25 more.

Trade Pricing Control (https://tradepricingcontrol.com/) is a set of free calculators that help small home service businesses quote jobs: window cleaning, pressure washing, junk removal, house cleaning and about 25 more. All of it is static HTML, CSS and vanilla JavaScript on a shared host behind Cloudflare. There is no build framework, no database and no API. Here is how it works and why I kept it that simple.

One engine, many calculators

Every calculator page has a container like <div data-calc="window-pricing"> and loads a single shared script, calc.js. The script looks up a definition object by that key and renders the form, the line items and the totals.

A definition is mostly data:

CALCS["window-pricing"] = {
  title: "Window cleaning quote",
  owner: true,              // business view: adds an hourly-rate check
  presets: [
    ["Small home", { std: 10, pic: 1, door: 1, screens: 10 }],
    // ...
  ],
  // each rate is a [low, high] range from a published 2026 cost guide
};

Adding a new trade means writing one more object and one more HTML page. The engine handles the rest: inputs, presets, formatting and the result card.

Three price levels from one range

Each rate is stored as a low and high number from a published source. A small helper turns that into three levels:

function mid(a, b) { return [a, (a + b) / 2, b]; }
var TIERS = ["Budget", "Typical", "Premium"];

Budget uses the low end, Typical the midpoint and Premium the high end. A slider moves every line item together anywhere between low and high, so you can match your own market instead of trusting a single national number.

Two more rules make the numbers realistic:

  • Minimums. If a source reports a typical minimum job charge, small jobs get raised to it.
  • Your own surcharges. Access, height and condition are left to the user, because they depend on your own costs.

The business calculators also divide the quote by the hours you enter, so you can see your effective hourly rate before you send the price.

"Save as PDF" without a PDF library

There's no jsPDF or html2pdf. The quote button adds a class to <body> and calls the browser's own print dialog:

document.body.classList.add("printing-quote");
window.addEventListener("afterprint", done);
window.print();

A print stylesheet hides everything except the quote, and the user picks "Save as PDF". It weighs nothing, works offline and looks the same in every browser.

Embeddable with one query parameter

Any calculator can run inside someone else's site. Each page shows a ready-to-copy iframe snippet, and the iframe loads the page with ?embed=1. A small embed.js sees that parameter and strips the page down to just the calculator.

Printable price lists

The site also has editable price list templates (for example https://tradepricingcontrol.com/price-lists/window-cleaning/). You type your business name and prices into the page and print it. Same trick: plain HTML plus a print stylesheet.

Sources, listed on every page

Every rate comes from a published 2026 US cost guide, and the sources are listed under each calculator. The assumptions I had to make, like estimating window count from home size, are written out on the methodology page: https://tradepricingcontrol.com/methodology/

Why static?

  • Speed. Pages are a single HTML file plus one shared script, cached by Cloudflare.
  • Nothing to break. No server code, no dependencies to update and no database to back up.
  • Cheap. It runs on basic shared hosting.

The tradeoff is that adding a calculator means editing files by hand, but with one engine and data-only definitions that takes minutes.

If you run a service business, or you're building something similar, the calculators are free to use and embed: https://tradepricingcontrol.com/

πŸ“° Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.