Convert quantities into a probability distribution
For one side with n valid levels and positive quantities qᵢ, define pᵢ = qᵢ/Σq. Shannon entropy is H = −Σpᵢ ln(pᵢ), using natural logarithms. Normalized entropy is H/ln(n) when n exceeds one, and effective levels equal exp(H). A one-level side has H = 0 and one effective level; this tool defines its normalized entropy as zero because ln(1) would otherwise create a zero denominator. Price fields identify the levels but do not weight this quantity-only statistic.
Compare even and concentrated quantities
Two levels with quantities five and five have shares 0.5 and 0.5. Entropy is ln(2), approximately 0.6931, normalized entropy is 1, and effective levels are 2. Quantities nine and one instead produce H of approximately 0.3251, normalized entropy of 0.4690, and about 1.384 effective levels. Both books have ten total units and two visible levels, yet their concentration differs substantially.
Keep depth and aggregation comparable
Adding very distant levels or changing the venue's price aggregation can alter entropy without improving executable liquidity near the midpoint. Compare the same number of levels or a consistent price band, and keep bids and asks separate. Duplicate aggregated prices can falsely create extra apparent levels unless validated before calculation. Entropy contains no direction signal by itself, and a high value is not a guarantee of low slippage. Inspect prices, total size, spread, and snapshot timing alongside concentration.