CalcWorldHub
Free online calculator · no signup

Binary Jensen–Shannon divergence calculator

Enter the event probability in each distribution on the 0–1 scale. The calculation also uses each event’s complementary probability.

Worked example
Relevant result
∑
Clear result · useful details
Default calculator result0.1325

Related calculators

Use these tools when your question extends to a neighboring part of the same calculation.

Browse statistics tools →

Binary Jensen–Shannon divergence calculator — Event probability in P (0–1), Event probability in Q (0–1) and calculation method
Binary Jensen–Shannon divergence calculator: inputs and calculation method.

How to use this calculator

Compare two Bernoulli probability distributions with symmetric Jensen–Shannon divergence in nats.

  1. Enter Event probability in P (0–1), Event probability in Q (0–1). Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Calculation guide

Binary Jensen–Shannon divergence calculator

Enter the event probability in each distribution on the 0–1 scale. The calculation also uses each event’s complementary probability.

What it measures

Jensen–Shannon divergence averages each distribution’s Kullback–Leibler divergence to their midpoint distribution. It is symmetric and finite for these Bernoulli inputs.

Inputs and units

  • Event probability in P (0–1): Probability of the event under distribution P, between 0 and 1.
  • Event probability in Q (0–1): Probability of the same event under distribution Q, between 0 and 1.

Formula and method

JSD(P,Q) = ½Dₖₗ(P‖M)+½Dₖₗ(Q‖M), where M=(P+Q)/2 and each Bernoulli vector is (p,1−p).

Worked example

For p = 0.8 and q = 0.3, the binary JSD with natural logarithms is about 0.1325 nats.

Interpreting the result

Zero means the two entered distributions match. The result is a divergence, not a distance; SciPy’s Jensen–Shannon distance is the square root of divergence.

Assumptions and limits

The inputs must be probabilities for the same binary event and population/model basis. Natural logarithms produce nats; another log base changes the unit and scale. Divergence alone does not express uncertainty or practical importance.

Sources and method

  • Defines Jensen–Shannon distance as the square root of Jensen–Shannon divergence; this page reports divergence in nats, not the square-root distance. SciPy: Jensen–Shannon distance

Frequently asked questions

Is this the same as Jensen–Shannon distance?

No. Distance is the square root of divergence; this page reports divergence.

What does zero divergence mean?

The two Bernoulli distributions are identical, so p and q match.

How do I use the Binary Jensen–Shannon divergence calculator?

Enter Event probability in P (0–1), Event probability in Q (0–1). Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of Binary Jensen–Shannon divergence?

For p = 0.8 and q = 0.3, the binary JSD with natural logarithms is about 0.1325 nats.

What does the Binary Jensen–Shannon divergence calculator calculate?

Compare two Bernoulli probability distributions with symmetric Jensen–Shannon divergence in nats.