{
  "schemaVersion": 1,
  "slug": "dividend-yield-calculator",
  "category": "finance",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "2cd8d51365459bc6b99fb513e599308de40ecdb6a4af10674f7444a4d3485c77",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/dividend-yield-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "Y = D ÷ P × 100; Yc = D ÷ C × 100; I = D × n; V = P × n",
    "vars": [
      [
        "D",
        "annual dividend per share"
      ],
      [
        "P",
        "current share price"
      ],
      [
        "C",
        "cost basis per share"
      ],
      [
        "n",
        "number of shares"
      ],
      [
        "Y",
        "dividend yield, %"
      ],
      [
        "Yc",
        "yield on cost, %"
      ],
      [
        "I",
        "annual dividend income"
      ],
      [
        "V",
        "position value"
      ]
    ],
    "note": "Y and Yc compute only when P or C is greater than 0, otherwise they return 0; I and V scale the per-share values by n."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "Investor.gov — Stocks, dividends and investment risks",
        "url": "https://www.investor.gov/introduction-investing/investing-basics/investment-products/stocks"
      }
    ],
    "referenceRole": "definition",
    "implementationHash": "2cd8d51365459bc6b99fb513e599308de40ecdb6a4af10674f7444a4d3485c77",
    "basis": "Y = D ÷ P × 100; Yc = D ÷ C × 100; I = D × n; V = P × n",
    "limitations": "The references explain definitions and methods; any extra preset must be checked against the assumptions on this page."
  },
  "contract": {
    "compute": "return { yield: sharePrice>0 ? annualDividend/sharePrice*100 : 0, yieldOnCost: costPerShare>0 ? annualDividend/costPerShare*100 : 0, annualIncome: annualDividend*shares, positionValue: sharePrice*shares };",
    "inputs": [
      {
        "name": "sharePrice",
        "type": "number",
        "default": 50,
        "min": 0.01,
        "max": 1000000,
        "step": 0.01
      },
      {
        "name": "annualDividend",
        "type": "number",
        "default": 2,
        "min": 0,
        "max": 100000,
        "step": 0.01
      },
      {
        "name": "shares",
        "type": "number",
        "default": 100,
        "min": 0,
        "max": 10000000,
        "step": 1
      },
      {
        "name": "costPerShare",
        "type": "number",
        "default": 45,
        "min": 0,
        "max": 1000000,
        "step": 0.01
      }
    ],
    "outputs": [
      {
        "name": "yield",
        "precision": 2,
        "unit": "%"
      },
      {
        "name": "yieldOnCost",
        "precision": 2,
        "unit": "%"
      },
      {
        "name": "annualIncome",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "positionValue",
        "precision": 2,
        "unit": "$"
      }
    ],
    "interpret": null
  }
}
