Blackjack Hand Value Calculator
This blackjack hand value calculator reads ordinary card codes and returns the strongest legal total for the hand.
Run — free
Aces begin at 11 and automatically fall to 1 whenever that prevents or reduces a bust. The result also tells you whether the total is soft, whether a two-card hand is a natural blackjack, and whether the hand is still over 21. Every code must identify one unique card from a standard 52-card deck, so malformed cards and impossible duplicates produce a clear input error.
Enter a real hand from a standard deck
Write each card as its rank followed immediately by its suit. Ranks are 2 through 10, J, Q, K, and A; suits are C for clubs, D for diamonds, H for hearts, and S for spades. Separate cards with spaces or commas, so AS 10H and AS,10H describe the same two-card hand. Letter case does not matter because codes are normalized before calculation. The calculator validates the complete code rather than guessing what a partial label means. For example, A without a suit is not a card in the standard 52-card set, and 1H is not an accepted substitute for AH. It also rejects the same exact card twice. Two kings of different suits are valid, but two copies of KS are impossible when the input represents one physical deck. These rules make the result suitable for game logic, test fixtures, tutorials, and hand-history processing where silently accepting an invented card could hide a larger data problem. A hand must contain at least one card and cannot contain more than the 52 unique cards available in the deck.
How ace adjustment finds the best total
The calculation first values every ace as 11, every face card as 10, and every numbered card at its printed rank. If that initial sum exceeds 21, the calculator changes one ace at a time from 11 to 1, subtracting 10 for each change. It stops as soon as the total is 21 or lower, or when no ace valued at 11 remains. This produces the highest total available under blackjack ace rules without busting whenever such a total exists. Consider AS 7D 3C: the initial value is 21, so the ace remains 11 and the result is a soft 21. For AS 7D 8C, the initial 26 becomes 16 after the ace falls to 1. Multiple aces use the same process: AS AD 9C starts at 31, then one ace changes to 1 for a final 21. The response reports how many aces were counted each way, making the adjustment transparent. If the total still exceeds 21 after all aces become 1, the hand is correctly marked as a bust rather than being forced into a legal score.
Read soft totals, blackjack, and bust status
The primary result is total, the best blackjack value of all supplied cards. The soft flag is true when at least one ace still counts as 11 in that best total. A soft hand has flexibility because drawing a high card may turn that ace into 1 instead of immediately causing a bust. The blackjack flag follows the usual natural-hand definition: it is true only when exactly two cards total 21. A three-card 21 is a valid 21 but is not labeled blackjack. The bust flag is true when the best possible value remains above 21, including after every ace adjustment. Additional fields provide the card count and the numbers of aces valued at 11 and 1, so applications do not need to reconstruct those facts from the original text. This distinction is useful in user interfaces and automated rules engines: a total alone cannot tell you whether 21 is natural, whether 18 is soft, or whether an ace has already lost its protective high value. Via the API, each deterministic calculation costs $0.002 per request.
What you can do with it
Score a blackjack game
Calculate a player's current total after each deal or hit while preserving the distinction between hard and soft hands.
Validate hand histories
Reject malformed or duplicated physical card codes before importing recorded rounds into analytics or replay tools.
Build strategy exercises
Generate dependable labels for natural blackjack, soft totals, hard totals, and bust examples used in training material.
FAQ
How should I write each card?
Use a rank followed by a suit letter, such as AS for ace of spades, 10H for ten of hearts, or KC for king of clubs. Separate cards with spaces or commas.
How are multiple aces counted?
Every ace starts at 11. While the total is above 21, aces change one at a time to 1 until the hand no longer busts or no high ace remains.
What makes a total soft?
A total is soft when at least one ace is still valued at 11. If every ace has been reduced to 1, the total is hard.
Does every 21 count as blackjack?
No. The blackjack flag is true only for a two-card 21. A total of 21 made with three or more cards is not a natural blackjack.
Why are duplicate card codes rejected?
The input models one standard 52-card deck. The same physical card cannot appear twice, although cards with the same rank and different suits are valid.
What does an API calculation cost?
Each API request costs $0.002. The algorithm is deterministic and uses no network service or random behavior.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/game/blackjack-hand-value \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"hand":"AS 7D 3C"}'const res = await fetch("https://api.kit.forhosting.com/game/blackjack-hand-value", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"hand": "AS 7D 3C"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/game/blackjack-hand-value",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"hand": "AS 7D 3C"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/game/blackjack-hand-value", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"hand":"AS 7D 3C"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"hand":"AS 7D 3C"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/game/blackjack-hand-value", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"hand": "AS 7D 3C"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "game.blackjack_hand_value",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_items | 52 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |