ForHosting KIT · Health & fitness

Pack years calculator

Smoking 20 cigarettes a day for 10 years adds up to 10 pack-years. Enter the average number smoked per day and how long that lasted to get the exposure figure that intake forms, screening notes and research records ask for. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Cigarettes per day
20
Years smoked
10
You get
Packs per day
1
Pack years
10
Cigarettes per pack
20

A pack years calculator turns average cigarettes per day and years of smoking into the single exposure number clinicians call pack-years. Enter how many cigarettes you (or a patient) smoked on a typical day and for how many years that rate continued; the tool divides daily cigarettes by twenty to get packs per day, multiplies by years smoked, and returns the pack-year total with packs-per-day, the fixed pack size of twenty cigarettes, a readable formula string, and ordered substitution steps. Clinic intake sheets, pulmonary teaching cases, research coding of smoking history, and automated grading of health-math homework all need that same deterministic product without a spreadsheet.

What pack-years mean for smoking history

Pack-years are a cumulative smoking-exposure unit used in respiratory medicine, oncology screening criteria, and research coding of tobacco history. By definition, one pack-year equals smoking one pack of twenty cigarettes per day for one year—or any combination that multiplies to the same product, such as two packs per day for six months or ten cigarettes per day for two years. The closed formula is pack-years equals cigarettes per day divided by twenty, then multiplied by years smoked.

That single real number does not capture brand, filter type, depth of inhalation, second-hand exposure, or years since quitting; it only compresses average intensity and duration into one comparable scalar. Teachers and automated graders care about the negative rejection as much as the successful numeric path: a student who enters minus five cigarettes has left the domain of the measure, and a silent absolute-value fallback would hide that mistake.

Zero cigarettes per day or zero years smoked is allowed and correctly yields zero pack-years, which matches never-smoker or never-started histories on many intake forms. The check path recomputes packs per day and the product with the same fixed rounding used for published fields, so a successful response always ships with steps you can assert in tests or worksheets. Classic teaching values include twenty cigarettes per day for ten years equals ten pack-years, and ten cigarettes per day for twenty years equals the same ten pack-years under the linear product.

Clinic intake and chart abstraction

Staff enter average cigarettes per day and years smoked from patient history and record the deterministic pack-year total for spirometry or screening notes.

What if cigarettes per day or years smoked is negative?

Negative intensity or duration is not a valid pack-year input; zero is allowed and yields zero pack-years.

Does this include cigars, pipes, or vaping?

No. This calculator uses cigarette count only with a fixed pack of 20. Convert other products to cigarette-equivalents yourself only if your protocol defines them.

Is pack-years the same as lung cancer risk?

No. Pack-years summarize cumulative cigarette exposure. Risk models may use pack-years plus age, quitting status, and other factors this tool does not compute.

Is the pack years calculator free?

The browser tool is free and runs locally.

How are pack-years calculated?

Divide the cigarettes smoked per day by 20 to get packs per day, then multiply by the years smoked. Ten cigarettes a day for 20 years also gives 10 pack-years, because only the product counts.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/health/pack-years

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/health/pack-years \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cigarettes_per_day":20,"years_smoked":10}'
{
  "cigarettes_per_day": 20,
  "years_smoked": 10
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "health.pack_years",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_cigarettes_per_day200
max_years_smoked120
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Negative daily counts or negative durations are rejected with invalid_input so form mistakes never invent a lifetime dose.

How to call the API and what comes back

Send a JSON body with two required finite non-negative numbers: cigarettes_per_day (aliases cpd, cigarettes, cigs_per_day, cigs, daily_cigarettes) and years_smoked (aliases years, years_of_smoking, smoking_years, duration_years). Absolute values must stay within the published limits of two hundred cigarettes per day and one hundred twenty years so intermediate products remain finite in IEEE double precision on the Worker and in the browser. On success the response echoes rounded cigarettes_per_day and years_smoked, sets packs_per_day to daily cigarettes divided by twenty, pack_years to the product of packs per day and years, cigarettes_per_pack to the constant twenty, formula to the pack-year expression string, message to a short English summary, and steps to an ordered array of substitution lines. Failed validation—missing fields, non-finite numbers, negative cigarettes or years, or values outside absolute limits—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.

Practical tips, limits, and related searches

Keep daily cigarette counts and durations inside the published absolute range so the product cannot overflow into a non-finite pack-year total that the solver must reject. Prefer sending numbers rather than pre-formatted strings when you control the client; string numbers are accepted only when they match a strict finite numeric pattern. Prefer this capability when you already have average cigarettes per day and years smoked and only need the pack-year product; if your source is a word problem, extract those two numbers first and convert packs-per-day narratives into cigarettes by multiplying by twenty. When teaching, pair examples: twenty cigarettes daily for ten years yields ten pack-years; forty cigarettes daily for five years also yields ten; half a pack (ten cigarettes) for four years yields two; deliberate negative cigarettes or negative years demonstrates the hard invalid_input path; and zero cigarettes with any years (or zero years with any cigarettes) demonstrates the zero pack-year success path for never-smokers. This landing targets people searching for a pack years calculator, smoking pack-year total, or cigarettes per day times years smoked online; it is not a lung-cancer risk model, not a cotinine converter, and not a tool for pipe, cigar, or e-cigarette pack-equivalents. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately send negative years. Round-trip checks are easy: recompute cigarettes divided by twenty times years by hand and confirm it equals the published pack_years within the same twelve-decimal rounding, and confirm that flipping only the sign of an input flips the response from success to invalid_input.

Unit tests for health calculators

Generate known-good pack-year fixtures plus deliberate negative rejections for coding kata expected values and EHR validator suites.

Teaching pulmonary and oncology exposure math

Students compare hand-written pack-year products against the API steps before discussing how intensity and duration trade off linearly.

How are pack-years calculated?

Pack-years = (cigarettes per day ÷ 20) × years smoked. One pack is defined as 20 cigarettes. Example: 20 cigarettes/day for 10 years = 10 pack-years.

Read the full KIT documentation →