Fix

American odds to implied probability: margin errors

Short answer: convert each American price with two formulas, one for plus prices and one for minus prices. The two sides of a market will then add up to more than 1, and the excess is the book's margin. Divide each side by that sum to get a fair probability. SportsDataHQ returns both numbers.

The symptoms

Odds math fails quietly. The code runs, the numbers look like probabilities, and the mistakes only show up when something downstream does not add up. These are the common signs:

  • The home and away probabilities for one game sum to 1.04 or 1.05 and a validation check complains.
  • A favorite comes out with a probability above 1, or a negative one.
  • A model trained on implied probabilities looks well calibrated on the training season and overconfident everywhere else, because the margin was never removed.
  • The "market average" for a game does not match the number in another tool, because one table averaged prices and the other averaged probabilities.
  • A whole-number total, such as 6, produces over and under probabilities that do not sum to 1, because pushes were ignored.

All of these come from one of three mistakes: using the wrong formula for the sign of the price, treating a margin-inclusive number as a fair one, or averaging in the wrong space.

Cause 1: two formulas, and the sign decides which

American odds are quoted as a number that is positive for the side paid more than the stake and negative for the side paid less. The conversion to a probability depends on the sign.

For a negative price, the probability is the price's absolute value divided by the absolute value plus 100. A price of -200 gives 200 over 300, which is 0.6667. For a positive price, the probability is 100 divided by the price plus 100. A price of +150 gives 100 over 250, which is 0.4. Using the positive formula on a negative price is the usual sign bug: -160 run through 100 / (price + 100) gives 100 / -60, which is -1.67, and every later step inherits that. A valid American price is never between -100 and +100, so +100 and -100 both mean 0.5. If your code ever receives 0 or a number such as -50, the input is bad, and you should reject it instead of converting it.

These conversions give you the probability the price implies as it stands. That is information about how a market was priced. It is not a forecast of the result, and it is not a payout calculation.

Cause 2: the margin is still in the number

A market with two outcomes is priced so that the two implied probabilities add up to more than 1. The surplus is the margin, sometimes called the vig or the overround. Two sides both priced at -110 each give 0.5238, and the pair sums to 1.0476, so a market the book treats as an even split carries almost 5 percent of margin.

You will see this in real game data. We checked one NHL game on December 6, 2026. Across eight books, the latest home price was -160 at the most common point and the away price was +135. Those convert to 0.6154 and 0.4255. They add up to 1.0409, so that book's margin is about 4.1 percent. The no-margin home probability is 0.6154 divided by 1.0409, which is 0.5912.

SportsDataHQ keeps the two ideas apart, so you can pick one on purpose. The odds rows carry mlHomeProb and mlAwayProb, which are the posted price converted as it stands, margin included. The get_game_probabilities tool returns, for the moneyline and for each spread and total line, two averages across books: avg_implied_prob, which averages each book's implied probability with the margin left in, and fair_prob, which removes the margin from each book's pair of prices first and then averages. The removal is proportional: each side is divided by the sum of both sides at the same line. Only identical lines are combined, so a total of 6 and a total of 6.5 are reported separately.

Cause 3: averaging prices instead of probabilities

If you want one number for a game across several books, the order of operations matters. American odds are not linear. A price of -110 and a price of +105 describe nearly the same probability, yet their arithmetic mean is -2.5, which is not a price at all. Converting each price to a probability and then taking the mean gives 0.5058, which is sensible. The rule is to convert first and average after.

The same rule applies to the margin. Remove it per book, on the pair of prices from the same book and the same line, and only then combine books. Taking one book's home price and another book's away price and normalizing the pair mixes two margins and can produce a fair probability that no book ever posted.

Step 1: convert with one function, test the edges

This snippet is the conversion we use below. It runs locally and has no API calls.

def implied(american):
    # probability the price implies, margin included
    return 100 / (american + 100) if american > 0 else -american / (-american + 100)

for price in (-200, -110, 100, 150, 300):
    print(f"{price:+5d} -> {implied(price):.4f}")

a, b = implied(-110), implied(-110)
print(f"-110 / -110 -> {a:.4f} + {b:.4f} = {a + b:.4f}; fair each {a / (a + b):.4f}")
print("mean of -110 and +105 =", (-110 + 105) / 2, "(not a valid American price)")
print("mean of the two probabilities =", round((implied(-110) + implied(105)) / 2, 4))

Ran locally on December 6, 2026. The five prices came out at 0.6667, 0.5238, 0.5, 0.4 and 0.25. The -110 pair summed to 1.0476 with a fair 0.5 each. Averaging the two prices gave -2.5, and averaging the two probabilities gave 0.5058.

Step 2: check your math against the API

This script pulls one game's odds, keeps each book's latest capture, converts the moneyline by hand and compares the result with get_game_probabilities. Set PUCKAPI_API_KEY first. It costs 10 credits for the odds and 5 for the probabilities.

import json, os, urllib.request
KEY = os.environ["PUCKAPI_API_KEY"]

def post(tool, body):
    req = urllib.request.Request(f"https://mcp.puckapi.com/v1/{tool}", data=json.dumps(body).encode(),
                                 headers={"Content-Type": "application/json", "x-api-key": KEY})
    with urllib.request.urlopen(req, timeout=30) as resp:
        print("HTTP", resp.status, tool)
        return json.load(resp)["data"]

def implied(american):
    return 100 / (american + 100) if american > 0 else -american / (-american + 100)

game = "2026020477"
latest = {}
for r in post("get_odds", {"game_id": game})["odds"]:        # one row per book and capture time
    if r.get("mlHome") is None or r.get("mlAway") is None:
        continue
    if r["bookmaker"] not in latest or r["capturedAt"] > latest[r["bookmaker"]]["capturedAt"]:
        latest[r["bookmaker"]] = r

raw, fair = [], []
for r in latest.values():
    h, a = implied(r["mlHome"]), implied(r["mlAway"])
    raw.append(h); fair.append(h / (h + a))
print(f"{len(fair)} books: mean implied home {sum(raw)/len(raw):.3f}, mean fair home {sum(fair)/len(fair):.3f}")
print("API:", post("get_game_probabilities", {"game_id": game})["moneyline"]["home"])

On the verified run, eight books each had a moneyline. Our hand calculation gave a mean implied home probability of 0.613 and a mean fair home probability of 0.591. The API returned avg_implied_prob 0.613 and fair_prob 0.591, so the two agree to three places. The first book in the list, priced -160 and +135, converted to 0.6154 plus 0.4255 for a sum of 1.0409 and a fair home value of 0.5912, which matches the working above.

Step 3: choose the number that fits the question

Use the margin-inclusive number when you want to know what a price says literally, for example when you compare one book's price over time. Use the fair number when you want a probability that sums to 1, for example as an input feature or when you compare the market's view with a model's view. Do not mix the two in one column.

Three more checks save debugging time. Compare the pair from one book at one capture time, since lines move. Keep whole-number totals separate from half-point totals, because a whole number can push, and fair_prob on those lines is the chance of each side given no push, so over and under sum to 1. For markets with three outcomes, such as a win, draw or loss in soccer, divide each probability by the sum of all three.

When not to use this

  • You need a prediction. Implied and fair probabilities describe how a market was priced. They are not the true chance of an outcome, and a proportional margin removal is one convention among several. Another method would shift the favorite and the long shot slightly.
  • You need live prices. Odds and props are pre-game only, so there is nothing after play begins.
  • You need a price history without gaps. Coverage varies by book, game and market, and a game can have eight books in one market and three in another, as the totals did in our check.
  • You want advice on a wager. This page converts numbers. It does not recommend a side, a stake or a book.

Get a free key

Checked against the live API on 2026-12-06. Questions: hello@sportsdatahq.com.