{
  "slug": "cost-basis",
  "title": "Cost Basis Calculator",
  "heading": "Average Cost Basis Calculator",
  "category": "financial",
  "url": "https://www.revenuelab.fyi/toolbox/cost-basis",
  "summary": "Average cost per share across multiple buys, plus break-even.",
  "description": "Averaging down lowers your break-even but raises your position size. Knowing the blended basis is the difference between a plan and hoping.",
  "formula": "Average basis = Total invested ÷ Total shares.",
  "dateModified": "2026-09-30",
  "run_url": "https://www.revenuelab.fyi/api/public/calc?tool=cost-basis",
  "inputs": [
    {
      "id": "p1",
      "label": "Buy 1 — price",
      "kind": "number",
      "hint": null,
      "default": 100,
      "unit": "$",
      "min": 0,
      "max": null
    },
    {
      "id": "s1",
      "label": "Buy 1 — shares",
      "kind": "number",
      "hint": null,
      "default": 50,
      "unit": null,
      "min": 0,
      "max": null
    },
    {
      "id": "p2",
      "label": "Buy 2 — price",
      "kind": "number",
      "hint": null,
      "default": 78,
      "unit": "$",
      "min": 0,
      "max": null
    },
    {
      "id": "s2",
      "label": "Buy 2 — shares",
      "kind": "number",
      "hint": null,
      "default": 50,
      "unit": null,
      "min": 0,
      "max": null
    },
    {
      "id": "p3",
      "label": "Buy 3 — price",
      "kind": "number",
      "hint": null,
      "default": 60,
      "unit": "$",
      "min": 0,
      "max": null
    },
    {
      "id": "s3",
      "label": "Buy 3 — shares",
      "kind": "number",
      "hint": null,
      "default": 100,
      "unit": null,
      "min": 0,
      "max": null
    },
    {
      "id": "current",
      "label": "Current price",
      "kind": "number",
      "hint": null,
      "default": 84,
      "unit": "$",
      "min": 0,
      "max": null
    }
  ],
  "outputs": [
    {
      "id": "basis",
      "label": "Average cost per share",
      "format": "currency",
      "hint": null,
      "primary": true
    },
    {
      "id": "shares",
      "label": "Total shares",
      "format": "number",
      "hint": null,
      "primary": false
    },
    {
      "id": "invested",
      "label": "Total invested",
      "format": "currency",
      "hint": null,
      "primary": false
    },
    {
      "id": "value",
      "label": "Current position value",
      "format": "currency",
      "hint": null,
      "primary": false
    },
    {
      "id": "gain",
      "label": "Unrealized gain/loss",
      "format": "currency",
      "hint": null,
      "primary": false
    },
    {
      "id": "gainPct",
      "label": "Return on the position",
      "format": "percent",
      "hint": null,
      "primary": false
    }
  ],
  "worked_example": {
    "inputs": [
      "Buy 1 — price: 100 $",
      "Buy 1 — shares: 50",
      "Buy 2 — price: 78 $",
      "Buy 2 — shares: 50",
      "Buy 3 — price: 60 $",
      "Buy 3 — shares: 100",
      "Current price: 84 $"
    ],
    "outputs": [
      "Average cost per share: $74.50",
      "Total shares: 200",
      "Total invested: $14,900.00",
      "Current position value: $16,800.00",
      "Unrealized gain/loss: $1,900.00",
      "Return on the position: 12.75%"
    ]
  },
  "how_to": {
    "title": "How to use this",
    "steps": [
      "Enter buy 1 — price ($).",
      "Enter buy 1 — shares.",
      "Enter buy 2 — price ($).",
      "Enter buy 2 — shares.",
      "Enter buy 3 — price ($).",
      "Enter buy 3 — shares.",
      "Enter current price ($).",
      "Read your average cost per share on the right — it updates as you type.",
      "Hit Share to keep the scenario or send it to someone."
    ]
  },
  "scenarios": [
    {
      "name": "Conservative",
      "description": "Lower-end numbers — what if things land soft?",
      "values": {
        "p1": 60,
        "s1": 30,
        "p2": 47,
        "s2": 30,
        "p3": 36,
        "s3": 60,
        "current": 50
      }
    },
    {
      "name": "Typical",
      "description": "Defaults — the most common real-world setup.",
      "values": {
        "p1": 100,
        "s1": 50,
        "p2": 78,
        "s2": 50,
        "p3": 60,
        "s3": 100,
        "current": 84
      }
    },
    {
      "name": "Ambitious",
      "description": "Higher-end numbers — what if things really pop?",
      "values": {
        "p1": 160,
        "s1": 80,
        "p2": 125,
        "s2": 80,
        "p3": 96,
        "s3": 160,
        "current": 134
      }
    }
  ],
  "limitations": [
    "Results are estimates before tax, fees, and inflation unless an input explicitly covers them.",
    "Rates are treated as fixed for the whole period — variable-rate products will drift from this projection.",
    "This is educational maths, not financial advice. Check anything contractual with the lender or your accountant."
  ],
  "faq": [
    {
      "q": "How does the average cost basis calculator work?",
      "a": "Averaging down lowers your break-even but raises your position size. Knowing the blended basis is the difference between a plan and hoping. The underlying maths is: Average basis = Total invested ÷ Total shares."
    },
    {
      "q": "What do I need to enter?",
      "a": "7 values: buy 1 — price, buy 1 — shares, buy 2 — price, buy 2 — shares, buy 3 — price, buy 3 — shares, and current price. Each field starts with a sensible default, so you can change one number at a time and watch the result move."
    },
    {
      "q": "What does the average cost per share result mean?",
      "a": "It is returned as a money amount in US dollars and updates live as you edit the inputs, so you can compare two or three versions of a scenario in a few seconds."
    },
    {
      "q": "Is this calculator free, and do I need an account?",
      "a": "Yes, it's free, and no account is required. Nothing you type is stored on our servers — the maths runs entirely in your browser."
    },
    {
      "q": "How accurate is the result?",
      "a": "It applies the standard formula exactly, so the arithmetic is precise. Results are estimates before tax, fees, and inflation unless an input explicitly covers them."
    },
    {
      "q": "Who is this tool for?",
      "a": "It's built for anyone comparing money scenarios before committing — budgeting a payment, sanity-checking a quote, or seeing what a change in rate or term actually costs."
    }
  ],
  "related": [
    "https://www.revenuelab.fyi/toolbox/stock-return",
    "https://www.revenuelab.fyi/toolbox/portfolio-rebalance"
  ],
  "license": "CC-BY-4.0",
  "citation": "RevenueLab — Cost Basis Calculator (https://www.revenuelab.fyi/toolbox/cost-basis)"
}