Logit Bias Calculator (OpenAI)
Set a logit_bias from −100 to +100 on any token and watch OpenAI's next-token softmax renormalize in real time — ban a word, force a Yes/No answer, or gently nudge. No API key, no cost, runs in your browser.
How it works
OpenAI's logit_bias parameter is a JSON map from token ID to a bias value in the range −100 to +100. That value is added to the token's logit — its raw, pre-softmax score — at every generation step, before sampling. The single most common mistake is to read the bias as a probability change; it is a logit change, and because probability is proportional to e^(logit), the effect is exponential.
- Get base logits. If you enter base probabilities
p_i, the tool normalizes them to sum to 1 and setsz_i = ln(p_i). Softmax is invariant to an additive constant, so this reproduces your distribution exactly. In raw-logit mode you typez_idirectly. - Add the bias.
z'_i = z_i + b_i, whereb_i ∈ [−100, 100]is that token's logit_bias (0 if you leave it alone). - Renormalize with softmax.
p'_i = exp(z'_i) / Σ_j exp(z'_j). To keepexpin range even at ±100, the tool subtracts the maximum adjusted logit first (the log-sum-exp trick) — numerically identical, but no overflow or NaN. - Interpret the result. Adding a bias
bmultiplies a token's unnormalized weight bye^b. Sob = −100drives the weight toe⁻¹⁰⁰ ≈ 3.7×10⁻⁴⁴(an effective ban, per OpenAI's help center), while the surviving tokens keep their relative proportions.b = +100on one token drives its share to ≈100%.
Because exp(ln(p_i) + b_i) = p_i · e^{b_i}, the tool cross-checks itself two ways: the softmax path above, and an independent "odds" path that computes the weights as p_i · e^{b_i} and normalizes. The badge in the calculator confirms the two agree. Like the AI Temperature & Top-p Visualizer, this tool operates on an example distribution you supply — real per-model logits depend on the model and full context and can only be seen through an API call, which this tool never makes.
Worked examples
Frequently asked questions
Sources & references
- OpenAI API Reference — Chat Completions logit_bias (range −100 to 100, ban/force behavior)
- OpenAI Help Center — Using logit bias to alter token probability
- OpenAI Tokenizer — find the real token IDs to bias for your model
The logit_bias range and ban/force semantics were last cross-checked against the OpenAI API reference and help center on 2026-07-11. The softmax and e^bodds identity are standard; the worked examples above double as the tool's reconciliation fixtures (tolerance 1e-6).
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want to suggest an improvement?
Email me at [email protected] — most fixes ship within 24 hours.