Skip to content
ENExplore Calculators

Softmax Calculator

Convert a vector of logits into a probability distribution using the softmax function.

About Softmax Calculator

Softmax converts a vector of arbitrary real-valued logits into a probability distribution that sums to 1: softmax(x_i) = e^(x_i) / Σ e^(x_j). It's the standard final activation for multi-class classification and the mechanism behind attention weights in transformers. The temperature parameter scales logits before exponentiation — lower temperature sharpens the distribution toward the largest logit (more confident/deterministic), while higher temperature flattens it toward uniform (more random), which is exactly how temperature sampling works in LLM text generation.

Formula

softmax(x_i) = e^(x_i / T) / sum(e^(x_j / T))

x_i
Logit value for class i
T
Temperature parameter (default 1)

Worked example

With the default values below, Softmax Calculator returns Max Probability of 0.6590. Change any input above and every figure here is recalculated in your browser.

Inputs used

Logits
2.0, 1.0, 0.1
Temperatureaccepts 0.01–10
1

Results

Max Probability
0.6590
Distribution Entropy
0.8467 nats

Step by step

  1. 1Scale logits by temperature: x_i / T= [2.000, 1.000, 0.100]
  2. 2Exponentiate (shifted by max for stability): e^(x_i − max)= [1.0000, 0.3679, 0.1496]
  3. 3Normalize: e^(x_i) / Σ e^(x_j)= [0.6590, 0.2424, 0.0986]

Assumptions and limits

  • The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 4 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Why subtract the maximum value before exponentiating?

This is a standard numerical stability trick: subtracting the max logit before exponentiating prevents overflow from very large exponentials, and it doesn't change the final result because it cancels out in the normalization.

How does temperature affect the output?

Temperature below 1 makes the distribution more peaked (closer to a one-hot/argmax choice), while temperature above 1 flattens it toward uniform, increasing randomness — this is the same temperature parameter used in LLM sampling.

What is entropy telling me here?

Entropy measures how uncertain or spread out the resulting probability distribution is; low entropy means the model is confident in one class, while high entropy means probabilities are more evenly spread across classes.

How is softmax related to cross-entropy loss?

Softmax converts logits to probabilities, and cross-entropy loss then measures how far those predicted probabilities are from the true label distribution — together they form the standard classification loss (softmax + cross-entropy).

Softmax Calculator – Calculate Softmax Probabilities