# Chlorine dose calculator, V1 frozen methodology Status: **frozen, shipped, 11/11 browser QA.** Documented 6 October 2026 from the live implementation in `blocks/chlorine-dose/`. Formulas, constants, the product list and the recommendation architecture do not change during implementation. If a real technical problem is found, report it before changing anything. This document exists so the methodology transfers with the site. The calculator is the asset; the reasoning behind its numbers is what makes it defensible, and that reasoning is not recoverable from reading the code. > **The live site matches this document.** Two disagreements were found on 6 October 2026 > and both were resolved the same day. §15 keeps the record. --- ## 1. Purpose and scope Two linked tools on one page. - **The dose calculator** answers "how much of this product do I add to raise free chlorine by this much". It needs volume, a current FC, a target FC and a product. It does not need cyanuric acid and works without it. - **The target advisor** answers "what should I be aiming for". It requires CYA and refuses to run without it, because a target chosen without CYA is not a target. Separating them is deliberate. The dosing arithmetic is objective chemistry. The target is a judgement call that depends on a chosen methodology, and conflating the two would hide the choice. Out of scope: pH, alkalinity, calcium hardness, salt, LSI, and anything about how long to run a pump. ## 2. The two decisions that shape everything **Products are grouped by what the label says, not by what the chemical is.** A bottle reading "12.5%" means one thing under EPA pesticide labelling and a different thing in trade usage, and the gap is 12.8%. The picker therefore asks which words appear on the bottle rather than asking the reader to know what they own. See §4. **Targets are read from a published table, never from a percentage.** The common shortcut is `target FC = CYA x 0.115`. TroubleFreePool publishes a table of whole-ppm values in 10 ppm steps, and no single percentage reproduces it: across the rows the minimum swings between 6.7% and 10% of CYA. The table is used verbatim. See §8. ## 3. Dosing formulas One ppm is one milligram per litre, so the chlorine a dose must deliver is the rise wanted multiplied by the water volume. ``` demand_g = delta_FC (ppm) x volume (litres) / 1000 trade % mL = demand_g x 100 / trade_percent weight % g_per_mL = (weight_percent / 100) x density x 0.9524 mL = demand_g / g_per_mL solid g = demand_g x 100 / available_chlorine_percent ``` Constants, exactly as implemented: | Constant | Value | Source | |---|---|---| | Litres per US gallon | 3.785411784 | exact, by definition | | mL per US fluid ounce | 29.5735296 | exact, by definition | | Grams per ounce | 28.349523 | exact, by definition | | NaOCl to Cl2 equivalent | 0.9524 | MW Cl2 / MW NaOCl = 70.90 / 74.44 | The 0.9524 factor converts sodium hypochlorite to its chlorine equivalent. Its inverse, 1.0499, reproduces the 1.05 figure the industry quotes, which is one of several cross-checks the derivation passed. ## 4. Trade percent against weight percent This is the single most consequential correction in the methodology, and it was nearly shipped wrong. - **Trade percent** is grams of available chlorine per 100 mL. It is a weight-per-volume figure and it is what the pool trade usually means by a percentage. - **Weight percent** is sodium hypochlorite as a fraction of the solution by mass. EPA pesticide registration states active ingredients this way, so it is what appears in the ingredients panel of a consumer bottle. They are not interchangeable, because hypochlorite solution is denser than water: ``` 12.5 weight % x 1.184 density x 0.9524 = 14.10 trade % ``` A bottle labelled 12.5% sodium hypochlorite by weight is therefore a 14.1 trade percent product. Dosing it as though it were 12.5 trade percent **overdoses by 12.76%**, every single time. At 10% the error is about 9%. The picker avoids this by grouping presets under the words on the label: - **Says "available chlorine"** goes to the trade basis. - **Says "sodium hypochlorite"**, which includes household bleach, goes to the weight basis with a density. The custom option is labelled "Something else, I know its trade %" so that choosing it is an explicit claim about which basis the reader is supplying. ## 5. Density assumptions Weight-basis products need the solution density. These values back-solve Olin's published dosing table to two decimal places, which is the check that validated the whole approach. | Product | Weight % | Density g/mL | |---|---|---| | Sodium hypochlorite 12.5% | 12.5 | 1.184 | | Sodium hypochlorite 10% | 10.0 | 1.145 | | Household bleach 8.25% | 8.25 | 1.11 | | Household bleach 6% | 6.0 | 1.08 | **Stated limitation, shown on the page:** published densities for 10% sodium hypochlorite range from about 1.13 to 1.20, and that spread alone moves the answer by roughly 6%. The trade-percent route avoids density entirely, which is a reason to prefer a label that gives you one. ## 6. Product list and reference doses The complete list as implemented. Amounts are per **+1 ppm FC in 10,000 US gallons**, computed from the constants in §3. | Product | Basis | Strength | Density | Per +1 ppm / 10k gal | Also adds | |---|---|---|---|---|---| | Available chlorine 12.5% | trade | 12.5 | — | 10.24 fl oz | nothing | | Available chlorine 10% | trade | 10.0 | — | 12.80 fl oz | nothing | | Sodium hypochlorite 12.5% | weight | 12.5 | 1.184 | **9.08 fl oz** | nothing | | Sodium hypochlorite 10% | weight | 10.0 | 1.145 | 11.74 fl oz | nothing | | Household bleach 8.25% | weight | 8.25 | 1.11 | 14.68 fl oz | nothing | | Household bleach 6% | weight | 6.0 | 1.08 | 20.74 fl oz | nothing | | Cal-hypo 73% | solid | 73.0 | — | 1.83 oz | 0.8 ppm CH | | Cal-hypo 65% | solid | 65.0 | — | 2.05 oz | 0.8 ppm CH | | Dichlor 56% | solid | 56.0 | — | 2.38 oz | 0.910 ppm CYA | | Trichlor 90% | solid | 90.0 | — | 1.48 oz | 0.607 ppm CYA | | Custom, trade % | trade | entered | — | — | unknown | The 10.24 against 9.08 pair is the whole point of §4. Both are 12.5% products; they differ by 12.76% because the percentages mean different things. ## 7. Dry products and by-products Dry products use the solid formula in §3 against their available chlorine percentage, and each carries something besides chlorine. **Dichlor adds 0.910 ppm CYA per ppm FC. Trichlor adds 0.607 ppm CYA per ppm FC.** Both are derived from molecular weights, and the derivation reproduces the available chlorine percentages printed on the products (trichlor 91.5% derived against about 90% labelled, dichlor dihydrate 55.4% against 56% labelled), which is a good sign the arithmetic is right. Chlorine is consumed within days. CYA is not, and leaves only by replacing water. Run a pool on trichlor through a season and the arithmetic is unforgiving: 2 ppm of chlorine a day for 120 days adds roughly **146 ppm** of CYA. **Cal-hypo adds 0.8 ppm calcium hardness per ppm FC**, for both the 73% and 65% products. A note on that figure, because it looks wrong at first. Pure calcium hypochlorite works out to 0.706 by stoichiometry. The implemented value is PHTA's 0.8, which reflects commercial product rather than the pure compound. PHTA's figure was adopted deliberately. The value is identical for 73% and 65% because it is expressed per ppm of chlorine delivered, and a weaker product is simply used in proportionally larger amounts. ## 8. CYA target lookup Read verbatim from the TroubleFreePool chart. Columns are CYA, minimum FC, target low, target high, SLAM level. | CYA | Min FC | Target | SLAM | |---|---|---|---| | 20 | 2 | 3 to 5 | 8 | | 30 | 2 | 4 to 6 | 12 | | 40 | 3 | 5 to 7 | 16 | | 50 | 4 | 6 to 8 | 20 | | 60 | 5 | 7 to 9 | 24 | | 70 | 5 | 8 to 10 | 28 | | 80 | 6 | 9 to 11 | 31 | | 90 | 7 | 10 to 12 | 35 | | 100 | 8 | 11 to 13 | 39 | **Round-up behaviour.** A CYA reading between rows uses the next row up, so 85 reads the 90 row. A reading below 20 uses the 20 row. **Above 100 there is no target**: the chart stops, and the calculator says so rather than extrapolating. The remedy offered is a partial drain and refill, because that is the only way CYA comes down. **No percentage formula is used anywhere.** Rounding up is the conservative direction, since under-chlorinating relative to CYA is the failure mode that grows algae. ## 9. CDC guidance and the two-ppm clarification Three sources are shown side by side for a pool at 80 ppm CYA, and the first two are both CDC. | Source | What it is | At CYA 80 | |---|---|---| | CDC, home pools | Consumer guidance for residential pools | At least 2 ppm | | CDC Model Aquatic Health Code | Model code for public aquatic venues | At least 2 ppm, CYA capped at 90 | | TroubleFreePool | Residential methodology, not a standard | Minimum 6, target 9–11, SLAM 31 | **Both CDC figures read 2 ppm rather than the 1 ppm often quoted because cyanuric acid is present.** CDC recommends at least 1 ppm free chlorine in pools generally, and raises that to at least 2 ppm when cyanuric acid or a stabilised product such as dichlor or trichlor is in use. At 80 ppm CYA it is in use, so 2 ppm is the applicable figure. This clarification appears on the page because a reader who knows the 1 ppm number will otherwise think the table is wrong. The page leads with the TroubleFreePool figures and shows the CDC minimum underneath, both labelled. It then uses the gap to make the point that matters: at 80 ppm CYA, CDC's floor is 2 and TroubleFreePool's is 6, so sitting at 4 ppm is comfortably above the public health minimum while already below the level that keeps algae out. That is how a pool passes a test strip and goes green in the same week. **MAHC is CDC.** They are not separate organisations, and the page does not present them as such. ### Approved CYA notice behaviour The notice fires when **either the current or the projected CYA exceeds 90 ppm**, with different wording for each case: - Already over: states the current figure, and if the dose adds CYA, states where it lands. - Crossing: states the move from current to projected. Both close with the same framing: 90 ppm is the operating limit the CDC Model Aquatic Health Code sets for public aquatic venues, it is a model code for commercial pools rather than a legal limit for a home, and CYA only comes down by replacing water. Firing on the current reading matters because a pool already at 95 ppm CYA dosing with liquid chlorine adds no CYA at all, so a projection-only trigger stays silent in exactly the situation the reader most needs to know about. This is live as of 6 October 2026. ## 10. Inputs and outputs **Dose calculator inputs.** Volume in gallons, prefilled from `sessionStorage` key `pp.pool` when the reader arrived from the volume calculator. Current FC, which ships blank with a "required" placeholder and deliberately has no zero default. Target FC. Product. **Dose calculator outputs.** Primary amount in fl oz or oz, secondary in mL or g, the CYA or calcium hardness the dose also adds where applicable, and the CYA notice where it applies. **Target advisor inputs.** CYA only. It refuses to produce a target without one. **Target advisor outputs.** Minimum FC, target range, SLAM level for the matched row, the CDC floor alongside, and the source of each. ## 11. Warnings and limitations - Figures assume the labelled strength. Hypochlorite loses strength in storage, faster in heat, so an old bottle delivers less than its label. - Density for weight-basis products is an assumption, and published values for 10% sodium hypochlorite span roughly 1.13 to 1.20, worth about 6%. - The calculator gives no pH guidance, and that is deliberate. Liquid chlorine and bleach are strongly alkaline going in, but as the chlorine is consumed the reaction returns the acidity, so over a full cycle liquid chlorine is close to pH neutral. A one-word label next to a dose would be wrong for the two most commonly used products. Trichlor genuinely is persistently acidic, cal-hypo is net alkaline, dichlor is near neutral. - Targets follow one published methodology among several. The choice is labelled and the alternatives are shown. - Without a CYA reading there is no target. The tool will not guess one, because a guessed target looks like an answer. ## 12. Excluded from V1 1. Any percentage formula for the FC target. The table is used verbatim. 2. A target when CYA is unknown. 3. A target above 100 ppm CYA. 4. pH, alkalinity, calcium hardness, salt or LSI calculations. 5. pH direction labels next to a dose. 6. A default or assumed CYA value. 7. A zero default on current FC. 8. Any claim that 90 ppm CYA is a legal limit for a residential pool. 9. Chlorine demand or loss-rate prediction over time. 10. Pump runtime or circulation advice. ## 13. QA reference cases Computed from the constants in §3 against the live implementation. | ID | Inputs | Expected | |---|---|---| | C1 | Available chlorine 12.5% trade, 10,000 gal, +1 ppm | 10.24 fl oz | | C2 | Sodium hypochlorite 12.5% weight, 10,000 gal, +1 ppm | **9.08 fl oz**, must not read 10.24 | | C3 | Household bleach 6% weight, 10,000 gal, +1 ppm | 20.74 fl oz | | C4 | Available chlorine 10% trade, 15,000 gal, FC 1 to 3 | 38.40 fl oz | | C5 | Cal-hypo 73%, 10,000 gal, FC 1 to 5 | 7.32 oz, CH +3.2 ppm | | C6 | Trichlor 90%, 20,000 gal, FC 2 to 4 | 5.93 oz, CYA +1.21 ppm | | C7 | Dichlor 56%, 10,000 gal, FC 1 to 4 | 7.15 oz, CYA +2.73 ppm | | C8 | CYA 15 / 30 / 85 / 100 | rounds to row 20 / 30 / 90 / 100; min 2 / 2 / 7 / 8 | | C9 | CYA 101 | no target, states the chart stops, offers partial drain | | C10 | Trichlor, CYA 88, FC 2 to 8 | projects CYA 91.6, crosses 90, notice fires | | C11 | Liquid chlorine, CYA 95, FC 2 to 6 | CYA unchanged at 95, notice fires on the current reading: "Your CYA is already above 90 ppm." | C2 is the gate. If it reads 10.24 the trade-against-weight correction is not deployed and every hypochlorite dose is 12.76% high. ## 14. Sources **Primary.** CDC healthy swimming guidance for home pools, including the raised 2 ppm minimum when cyanuric acid is present. CDC Model Aquatic Health Code, for the public-venue CYA limit of 90 and the 2 ppm minimum with CYA present. **Industry standard.** PHTA, for the cal-hypo calcium hardness factor of 0.8 per ppm FC. **Methodology.** TroubleFreePool FC/CYA chart, used verbatim for minimum, target and SLAM. A published residential methodology, not a standard, and labelled as such on the page. **Manufacturer.** Olin hypochlorite dosing tables and product specifications, which the density back-solve reproduces to two decimal places. **Derived.** Molecular weights for the NaOCl to Cl2 factor and for the dichlor and trichlor CYA contributions. The derivations reproduce the available chlorine percentages printed on the products, which is the cross-check that validated them. ## 15. Resolved disagreements, 6 October 2026 Both were found by comparing the theme source against the file the site was actually serving, while writing this document. Both are now fixed and verified live. Kept here because the first one is a failure mode worth not repeating. ### 1. The CYA notice was running an earlier draft `blocks/chlorine-dose/view.js` differed between the repository and the deployed site in exactly one place, the notice trigger. Every dosing formula, every constant, the product table and the FC/CYA table were byte-identical, so no dose and no target was ever affected. | | Earlier draft, was live | Approved, now live | |---|---|---| | Trigger | projected CYA over 90 only, and only for a CYA-adding product | current CYA over 90 **or** projected over 90, any product | | CYA 95 on liquid chlorine | silent | fires | | CYA 88 on trichlor, FC 2 to 8 | fires | fires | | Wording | one crossing message | separate text for already-over and for crossing | The reader who most needed the warning, already over the limit and using a product that would not make it worse, was the one not getting it. **Cause: the fix was written, reviewed and never deployed.** The same thing had already happened once on this project with the volume calculator's handoff chips. A local edit is not a shipped edit, and the only reliable check is comparing checksums against the serving file, which is now how deploys are verified. ### 2. The page understated the target range The chart row for 80 ppm CYA is `(80, 6, 9, 11, 31)`, a target range of 9 to 11. The sources table read "Minimum 6, target 9, shock 31", dropping the upper bound. This was prose only; the advisor itself always read the row correctly and reported the full range. It was introduced on 6 October when that row was corrected from an earlier "9 to 11 ppm" that showed the range but omitted the minimum. The fix restored the minimum and lost the range. Both now appear: **Minimum 6, target 9–11, shock 31**. ### Verification | Case | Expected | Result | |---|---|---| | CYA 95, liquid chlorine, FC 2 to 6 | notice fires, "already above 90 ppm" | pass | | CYA 88, trichlor, FC 2 to 8 | notice fires, "from 88 to about 92 ppm, crossing 90" | pass | | CYA 80, liquid chlorine, FC 2 to 6 | no notice | pass | Deployed `view.js` checksum matches the repository. `render.php`, the other two calculators and `functions.php` were unchanged by the deploy, confirmed by checksum before and after.