betbetter / yii2-novig
No-Vig Odds Calculator widget for Yii 2: turn bookmaker odds into fair, margin-free odds and probabilities.
Requires
- php: >=7.4
- yiisoft/yii2: ~2.0.14
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-11-15 20:40:59 UTC
README
A small Yii 2 widget that removes the bookmaker margin (the "vig" or "overround") from betting odds, so visitors can see the fair odds and the true chance behind any price.
- 2-way markets (tennis, basketball, head-to-head) or 3-way markets (home / draw / away)
- Decimal (2.50) or American (+150 / -110) odds
- Shows the fair chance, fair odds and the bookmaker margin as the visitor types
- Runs in the browser: no API key, no external requests, no cookies
- Labels can be overridden for translation
Installation
composer require betbetter/yii2-novig
Usage
use betbetter\novig\NoVigWidget;
echo NoVigWidget::widget(); // 2-way, decimal odds
echo NoVigWidget::widget([
'outcomes' => 3, // home / draw / away
'format' => 'american', // +150 / -110
]);
Options
| Option | Values | Default |
|---|---|---|
outcomes | 2 or 3 | 2 |
format | 'decimal' or 'american' | 'decimal' |
showCredit | show a small "how the margin is removed" link | false |
options | HTML attributes for the container | [] |
labels | override any label, e.g. ['home' => 'Local'] | English |
How it works
Each price is turned into an implied probability (1 / decimal odds). The probabilities are added up; anything above 100% is the bookmaker margin. Each probability is divided by the total so they add up to 100% again (the proportional method), giving the fair chance and the fair odds.
Example: 1.91 / 1.91 adds up to 104.7%, so the margin is 4.7% and the fair odds are 2.00 / 2.00.
For reference, across 69.6 million pre-match markets (July to September 2026) the average margin was about 4.8% on two-way match bets and 7.6% on player props: State of the Vig 2026 (open data, CC BY 4.0). A browser version is at betbetter.world/tools/no-vig-calculator.
Licence
MIT. Made by Bet Better.