{
  "id": "blackjack",
  "version": "33061ba75463",
  "status": "published",
  "name": "Blackjack Calculator",
  "question": "Should I hit or stand in blackjack?",
  "summary": "Computes exact infinite-deck blackjack odds for one hand against the dealer’s up card: the expected result of hitting and of standing, the chance to bust, and the dealer’s final totals.",
  "category": "game",
  "subcategory": "betting",
  "url": "https://www.acalculator.org/game/blackjack-calculator",
  "markdown": "https://www.acalculator.org/game/blackjack-calculator.md",
  "kind": "function",
  "method": "Infinite deck (each card value 1/13, ten-values 4/13). Dealer final totals by recursion from the up card, given no dealer blackjack. Stand = P(win) − P(lose); hit = average over the next card of the better of standing and hitting again.",
  "assumptions": [
    "An infinite deck: every card has the same chance whatever has been dealt. With 6 or 8 decks the numbers differ only slightly.",
    "The dealer checks for blackjack first, and these odds assume the dealer does not have one.",
    "Only hit and stand are compared; doubling, splitting and surrender are not.",
    "A total of 21 is an ordinary 21, not a two-card blackjack. A win pays 1 to 1.",
    "Results are mathematics, not betting advice."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "total": {
        "title": "Your hand total",
        "description": "The total of your cards, counting an ace as 11 when the hand is soft.",
        "type": "integer",
        "minimum": 4,
        "maximum": 21
      },
      "hand": {
        "title": "Hand",
        "description": "Soft if an ace in your hand counts as 11 (such as ace and 6, soft 17); hard otherwise.",
        "type": "string",
        "enum": [
          "hard",
          "soft"
        ]
      },
      "up": {
        "title": "Dealer’s up card",
        "description": "The dealer’s face-up card. 10, jack, queen and king all count as 10.",
        "type": "string",
        "enum": [
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "A"
        ]
      },
      "rule": {
        "title": "Dealer on soft 17",
        "description": "Whether the dealer stands or hits on a soft 17 (the table rules say which).",
        "type": "string",
        "enum": [
          "s17",
          "h17"
        ]
      }
    }
  },
  "outputs": {
    "hand": {
      "label": "Your hand",
      "description": "Your total with hard or soft, such as hard 16 or soft 17.",
      "format": "text"
    },
    "play": {
      "label": "Better play",
      "description": "Hit or stand: the choice with the higher expected result (hit or stand only).",
      "format": "text"
    },
    "stand": {
      "label": "Expected result of standing",
      "description": "The average win or loss per bet if you stand, as a percent of the bet.",
      "format": "percent"
    },
    "hit": {
      "label": "Expected result of hitting",
      "description": "The average win or loss per bet if you take a card and then keep hitting or standing, whichever is better.",
      "format": "percent"
    },
    "bust": {
      "label": "Chance the next card busts you",
      "description": "The chance that one more card takes your total over 21.",
      "format": "percent"
    },
    "win": {
      "label": "Chance to win if you stand",
      "description": "The chance the dealer busts or ends below your total.",
      "format": "percent"
    },
    "push": {
      "label": "Chance to push if you stand",
      "description": "The chance the dealer ends on your total.",
      "format": "percent"
    },
    "lose": {
      "label": "Chance to lose if you stand",
      "description": "The chance the dealer ends above your total without busting.",
      "format": "percent"
    },
    "dealerBust": {
      "label": "Dealer busts",
      "description": "The chance the dealer’s hand goes over 21.",
      "format": "percent"
    },
    "dealer17": {
      "label": "Dealer ends on 17",
      "description": "The chance the dealer stops on 17.",
      "format": "percent"
    },
    "dealer18": {
      "label": "Dealer ends on 18",
      "description": "The chance the dealer stops on 18.",
      "format": "percent"
    },
    "dealer19": {
      "label": "Dealer ends on 19",
      "description": "The chance the dealer stops on 19.",
      "format": "percent"
    },
    "dealer20": {
      "label": "Dealer ends on 20",
      "description": "The chance the dealer stops on 20.",
      "format": "percent"
    },
    "dealer21": {
      "label": "Dealer ends on 21",
      "description": "The chance the dealer stops on 21.",
      "format": "percent"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "total": 16,
      "hand": "hard",
      "up": "10",
      "rule": "s17"
    },
    "outputs": {
      "hand": "hard 16",
      "play": "Hit",
      "stand": -54.0430333994985,
      "hit": -53.982634628108684,
      "bust": 61.53846153846154,
      "win": 22.978483300250748,
      "push": 0,
      "lose": 77.02151669974924,
      "dealerBust": 22.978483300250748,
      "dealer17": 12.070970006616518,
      "dealer18": 12.070970006616518,
      "dealer19": 12.070970006616518,
      "dealer20": 37.07097000661651,
      "dealer21": 3.7376366732831845
    },
    "text": "With hard 16 against a dealer 10, J, Q or K, the better play is: Hit."
  },
  "examples": [
    {
      "given": {
        "total": 16,
        "hand": "hard",
        "up": "10",
        "rule": "s17"
      },
      "expect": {
        "play": "Hit",
        "stand": -54.043,
        "hit": -53.9826,
        "bust": 61.53846153846154
      },
      "source": "Wizard of Odds, Expected Returns in Infinite-Deck Blackjack (stand −0.540430, hit −0.539826, rounded to 6 decimals): https://wizardofodds.com/games/blackjack/expected-return-infinite-deck/",
      "tolerance": 0.00002
    },
    {
      "given": {
        "total": 12,
        "hand": "hard",
        "up": "4",
        "rule": "s17"
      },
      "expect": {
        "play": "Stand",
        "stand": -21.1063,
        "hit": -21.3537
      },
      "source": "Wizard of Odds, Expected Returns in Infinite-Deck Blackjack (stand −0.211063, hit −0.213537): https://wizardofodds.com/games/blackjack/expected-return-infinite-deck/",
      "tolerance": 0.00005
    },
    {
      "given": {
        "total": 20,
        "hand": "hard",
        "up": "6",
        "rule": "s17"
      },
      "expect": {
        "play": "Stand",
        "stand": 70.3959,
        "dealerBust": 42.31504920849977
      },
      "source": "Wizard of Odds, Expected Returns in Infinite-Deck Blackjack (stand 0.703959); dealer bust from the dealer recursion in content.mdx, Python 3 fractions",
      "tolerance": 0.000002
    },
    {
      "given": {
        "total": 17,
        "hand": "soft",
        "up": "9",
        "rule": "s17"
      },
      "expect": {
        "play": "Hit",
        "stand": -42.3154,
        "hit": -14.9787
      },
      "source": "Wizard of Odds, Expected Returns in Infinite-Deck Blackjack (17 standing vs 9 −0.423154; soft 17 hitting vs 9 −0.149787): https://wizardofodds.com/games/blackjack/expected-return-infinite-deck/",
      "tolerance": 0.000005
    },
    {
      "given": {
        "total": 16,
        "hand": "hard",
        "up": "A",
        "rule": "s17"
      },
      "expect": {
        "play": "Hit",
        "stand": -66.6951,
        "hit": -51.7149
      },
      "source": "Wizard of Odds, Expected Returns in Infinite-Deck Blackjack (stand vs ace −0.666951, hit −0.517149): https://wizardofodds.com/games/blackjack/expected-return-infinite-deck/",
      "tolerance": 0.000002
    },
    {
      "given": {
        "total": 16,
        "hand": "hard",
        "up": "6",
        "rule": "h17"
      },
      "expect": {
        "dealerBust": 43.94665749017438,
        "dealer17": 11.483768183348829
      },
      "source": "dealer recursion in content.mdx with the dealer hitting soft 17; Python 3 fractions (progress log)"
    }
  ],
  "sources": [
    "Wizard of Odds, Expected Returns in Infinite-Deck Blackjack (stand and hit tables, dealer stands on soft 17): https://wizardofodds.com/games/blackjack/expected-return-infinite-deck/",
    "Wizard of Odds, Dealer Odds in Blackjack under U.S. Rules (dealer final totals, given no dealer blackjack): https://wizardofodds.com/games/blackjack/dealer-odds-blackjack-us-rules/",
    "Grinstead and Snell, Introduction to Probability, 2nd ed., American Mathematical Society, chapter 4, conditional probability: https://math.dartmouth.edu/~prob/prob/prob.pdf",
    "National Council on Problem Gambling, help and treatment (1-800-MY-RESET): https://www.ncpgambling.org/help-treatment/"
  ],
  "related": [
    "poker-odds",
    "implied-probability",
    "odds"
  ],
  "changelog": [
    {
      "date": "2026-09-28",
      "note": "Your hand output (hard or soft) and the sentence names it (WP-70 QA)."
    }
  ]
}
