coffee-habit-cost-calculator
Compare the total nominal cost of a recurring coffee habit (drink price × times per week × years) against what the same weekly amount would have grown to if invested at a given annual return. Returns total spent, invested future value, and the opportunity-cost gap. The goal is to make compounding visible — not to moralize about coffee.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| drink | Yes | Drink preset. 'latte' (~$5.75), 'cappuccino' (~$5.25), 'drip-coffee' (~$3.25), 'cold-brew' (~$5.50), or 'custom' to provide custom_price. | |
| years | Yes | Horizon in years over which the habit continues. Decimals allowed (e.g. 30 for a working career, 10 for a decade). | |
| custom_price | No | Required when drink='custom'. Price per drink in dollars (e.g. 4.50). Ignored for presets. | |
| times_per_week | Yes | How many drinks per week. Fractional is allowed (e.g. 5 weekdays, or 2.5 for an every-other-day habit). | |
| annual_return_percent | Yes | Expected nominal annual return on the alternative investment, as a percentage (e.g. 7 for 7%). 7% real or 10% nominal are common long-term US stock-market assumptions. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| drink_price | Yes | Resolved price per drink (preset or custom). | |
| total_spent | Yes | Total nominal dollars spent on coffee over the horizon. | |
| total_weeks | Yes | Number of weekly contributions / drinks (years × 52, rounded to integer). | |
| annual_spend | Yes | weekly_spend × 52. | |
| weekly_spend | Yes | drink_price × times_per_week. | |
| invested_value | Yes | Future value of investing the same weekly amount at annual_return_percent over the horizon (end-of-week contributions). | |
| opportunity_cost | Yes | invested_value − total_spent. Positive when the investment outgrows the cash spent (typical with positive return). |