Blackjack (21)

Dealt with the Web Crypto API for cryptographically secure randomness.

Your bet

Balance: 1,000
Stake
Pick a stake, then deal to play a hand.

Play money only — no real wagering. A natural blackjack pays 3 : 2, an ordinary win pays even money, and a push returns your stake; the house edge means the balance drifts down over time, just like the real game.

About Blackjack

Blackjack — also called 21 — is the most popular casino card game. You play one hand against the dealer, aiming to finish with a total closer to 21 than the dealer without going over. Number cards are worth their face value, face cards are worth 10, and an Ace is worth 11 or 1 — whichever helps most. Beat the dealer and you win; go over 21 and you bust and lose.

How to play

  1. Pick a stake and deal — you and the dealer each get two cards.
  2. One dealer card stays face down. If either two-card hand is a natural blackjack (an Ace with a ten-value card), the hand resolves right away.
  3. Otherwise take your turn: Hit to draw another card, Stand to keep your total, or Double to double your stake, take exactly one more card, and stand. Going over 21 busts and loses immediately.
  4. When you stand, the dealer reveals the hole card and draws until reaching at least 17 — the dealer stands on all 17s, including a soft 17.
  5. Whoever is closer to 21 wins. A natural blackjack pays 3 : 2, an ordinary win pays 1 : 1, and an equal total pushes (your stake is returned).

Card values and soft hands

  • 2 through 10 — worth their face value.
  • Jack, Queen, King — each worth 10.
  • Ace — worth 11 unless that would push the hand over 21, in which case it counts as 1.
  • A hand holding an Ace still counted as 11 is called soft (for example, Ace + 6 is a soft 17) — it cannot bust on the next card. Once the Ace must count as 1 the hand is hard.

Basic strategy at a glance

Basic strategy is the mathematically best play for every hand against the dealer’s upcard. A few durable rules of thumb:

  • Always stand on a hard 17 or higher; always hit a hard 11 or lower.
  • Stand on 12–16 when the dealer shows 2–6 (the dealer is likely to bust); hit 12–16 when the dealer shows 7 or higher.
  • Double a hard 11, and usually a 10, against a weak dealer card.
  • Never take insurance — it is a losing side bet over time.

This is a simplified summary; a full basic-strategy chart adjusts for soft hands and pairs.

How it works

  1. Each card is drawn by generating a cryptographically secure 32-bit unsigned integer in your browser
  2. The integer is mapped to one of the 52 cards using modular arithmetic — every rank and suit equally likely, reshuffled each hand
  3. Ace totals, natural blackjacks, and the dealer’s stand-on-17 play are all computed locally
  4. Your bet is settled and the balance updated — instantly, with no server request

Simplifications and follow-ups

This is a single-hand game against the dealer. Splitting pairs, insurance, surrender, multi-hand play, and a card-counting trainer are possible future additions — for now, focus on the core hit / stand / double loop and the 3 : 2 blackjack payout.