The E Value Calculator estimates the expected number of random sequence matches given alignment score, database size, and query length.
Report an issue
Spotted a wrong result, broken field, or typo? Tell us below and we’ll fix it fast.
E Value Calculator Explained
An E-value, or expected value, is the predicted number of alignments with a score at least as high as the observed score that would occur by chance. In practical terms, a smaller E-value means stronger evidence that your sequence match is not random. An E-value of 1 suggests about one random hit of similar quality is expected in the database. An E-value of 1e-5 suggests such a hit would be rare by chance.
Bioinformatics tools like BLAST report both a bit score and an E-value for each alignment. The bit score puts alignments on a comparable scale, while the E-value accounts for database size. Because the E-value depends on database length and scoring parameters, it is not a fixed property of the alignment alone. Understanding these factors helps you compare hits across runs and databases with more confidence.

The Mechanics Behind E Value
The statistical foundation of E-values in sequence alignment is the extreme value distribution (EVD). Under Karlin–Altschul theory, high-scoring local alignments between random sequences follow an EVD. Two parameters, lambda (λ) and K, summarize the scoring system’s scale and the expected density of high-scoring segment pairs.
- Search space: The effective number of comparisons, roughly the product of query length and database length after length adjustments.
- Scoring system: Substitution matrix and gap costs influence the distribution of scores through λ and K.
- Extreme value behavior: The maximum alignment scores among many trials follow an EVD, enabling closed-form approximations.
- Bit score normalization: Converting raw scores to bits removes dependence on the scoring matrix, simplifying comparisons.
- Composition and masking: Low-complexity filtering and composition-based statistics adjust parameters to control false positives.
These mechanics allow a concise equation that predicts how many random alignments will reach a given score. The larger the search space, the more likely random high scores occur, increasing the E-value. Conversely, higher alignment scores decrease the E-value exponentially.
Formulas for E Value
Several equivalent formulas are common in BLAST statistics. Some use the raw alignment score, while others use the bit score. Choose the form based on the inputs you have.
- Using raw score S: E = K × m × n × e^(−λS), where m is query length and n is database length.
- Bit score S′ from raw score: S′ = (λS − ln K) / ln 2. This normalizes scores into bits.
- Using bit score directly: E = m × n × 2^(−S′). This is often the simplest in practice.
- Relation to P-value: For small E, P ≈ 1 − e^(−E) ≈ E. Thus very small E-values are approximately equal to P-values.
- Length adjustments: BLAST often uses effective lengths m′ and n′ after a length adjustment l. Then E = K × m′ × n′ × e^(−λS).
When available, the bit score formulation simplifies calculations and facilitates comparisons across scoring schemes. If only the raw score is known, you will need λ and K for your matrix and gap penalties to compute the E-value.
Inputs and Assumptions for E Value
The calculator expects information about your alignment and the database so it can apply Karlin–Altschul statistics. Provide the best estimates you have for lengths and scores or choose the parameters consistent with your BLAST run.
- Query length (m), in nt or aa, optionally adjusted for masking.
- Database length (n), the total target length searched, after any filters or subset selection.
- Alignment score as bit score (S′) or raw score (S). Prefer S′ if available.
- Statistical parameters λ and K when using a raw score; these depend on the matrix and gap costs.
- Optional length adjustment (l) or effective lengths (m′, n′) if you want BLAST-like corrections.
E-values range from extremely small numbers (e.g., 1e-180) to large values. Very small E-values can underflow on some systems; we clip them to a minimum representable value. If your input implies negative or undefined E-values, check the score, lengths, and parameters, as the model requires nonnegative search space and physically plausible scores.
Using the E Value Calculator: A Walkthrough
Here’s a concise overview before we dive into the key points:
- Select whether you will enter a bit score (S′) or a raw score (S).
- Enter the query length m in nt or aa, matching your alignment type.
- Enter the database length n that was actually searched.
- If using a raw score, choose the scoring matrix and gap costs or enter λ and K directly.
- (Optional) Provide effective lengths m′ and n′ if you want a BLAST-style length adjustment.
- Click Calculate to compute E and the approximate P-value.
These points provide quick orientation—use them alongside the full explanations in this page.
Example Scenarios
Protein search with a strong hit: You aligned a 300 aa query against a 50,000,000 aa protein database and obtained a bit score S′ = 80. Using E = m × n × 2^(−S′), E = 300 × 50,000,000 × 2^(−80). Since 2^(−80) is about 7.9e−25, E ≈ 1.2e−14. The approximate P-value is also near 1.2e−14, which indicates an extremely significant hit unlikely by chance. What this means: You can trust this alignment as biologically meaningful, assuming no low-complexity artifacts.
Nucleotide search with a short query: You align a 25 nt query against a 1,000,000,000 nt database and get a bit score S′ = 35. Compute E = 25 × 1,000,000,000 × 2^(−35). With 2^(−35) ≈ 2.9e−11, E ≈ 0.73. The chance of at least one such random hit is P ≈ 1 − e^(−0.73) ≈ 0.52, which is not compelling evidence. What this means: The hit may be random; increase score, lengthen the query, or filter low complexity to improve specificity.
Limits of the E Value Approach
E-values rest on idealized statistical assumptions. Violations can lead to overconfident or overly conservative assessments. Awareness of the limits helps you interpret results responsibly, especially with short or biased sequences.
- Independence assumption: Overlapping or related sequences reduce independence and can inflate significance.
- Composition bias: Low-complexity or skewed composition can yield high scores by chance; masking helps but is imperfect.
- Parameter mismatch: Incorrect λ and K for your scoring scheme produce wrong E-values.
- Heuristic effects: Seed heuristics, filtering, and gapping algorithms influence observed scores and their distribution.
- Search space drift: Effective database length changes with masking, redundancy, or subset databases and should match what was searched.
Use E-values alongside other evidence such as coverage, identity, conserved domains, and biological context. When in doubt, replicate searches, adjust filters, or confirm with reciprocal searches.
Units Reference
Units and symbols help you enter consistent values. Scores and lengths mix in the formulas, and some parameters carry implicit units. The table below summarizes common symbols and how to interpret them in calculations.
| Symbol | Meaning | Typical units |
|---|---|---|
| m | Query length | nt or aa |
| n | Database length searched | nt or aa |
| S | Raw alignment score | Score units (matrix + gap scheme dependent) |
| S′ | Bit score | Bits |
| λ | Scale parameter relating score units to probability | Per score unit (dimensionless with S) |
| K | Scale for expected number of high-scoring segments | 1 per length unit |
Use the table as a checklist when entering values. Make sure the type of length (nt vs aa) and the scoring system for λ and K match your alignment settings.
Troubleshooting
If results look odd, a few common issues may be responsible. Double-check all inputs against your alignment settings and database.
- E-value is much larger than BLAST’s: Database length or effective lengths differ from your run.
- E-value is zero or underflow: The bit score is very high; the true E-value is just below the minimum displayable number.
- Negative or NaN results: Invalid inputs such as negative lengths or missing parameters for raw scores.
- Unexpectedly small E for low-complexity regions: Enable masking or use composition-based statistics.
- Mismatched matrix/gap costs: λ and K must match the scoring system used to produce the score.
When in doubt, recompute the bit score from the raw score using the correct λ and K, or pull the bit score directly from the alignment output. Keep your database length consistent with what the search actually scanned.
FAQ about E Value Calculator
What is a “good” E-value?
It depends on context, but for many searches E-values below 1e-5 are considered strong evidence. Protein alignments often warrant stricter thresholds than nucleotide searches with short queries.
Does the E-value depend on database size?
Yes. E increases linearly with the effective database length. A hit can appear less significant in a larger database, even with the same alignment score.
How is the E-value different from a P-value?
E is the expected count of random hits at least as good as the observed score. For small E, P ≈ E. For larger E, P = 1 − e^(−E), which differs more from E.
Can I compare E-values across different scoring matrices?
Only with care. Use bit scores to compare across matrices, or ensure λ and K match the scoring scheme used. E-values also reflect database size, which must be comparable.
Key Terms in E Value
E-value
The expected number of alignments with a score at least as high as observed that would occur by chance in the searched database.
P-value
The probability of observing at least one random alignment with a score as high as observed. Approximates E for small values.
Raw score
The alignment score computed from a substitution matrix and gap penalties before normalization, in matrix-specific units.
Bit score
A normalized alignment score in bits that allows comparison across different scoring systems and searches.
Lambda (λ)
A scale parameter linking score units to probability under the extreme value model for local alignment scores.
K
A parameter describing the expected number of high-scoring segment pairs per unit search space under the model.
Search space
The effective number of independent comparisons, often approximated by the product of effective query and database lengths.
Extreme value distribution
A probability distribution governing the maximum of many random variables; it models the distribution of top alignment scores.
Sources & Further Reading
Here’s a concise overview before we dive into the key points:
- NCBI BLAST Help: Statistics and parameters
- Karlin and Altschul (1990) Methods for assessing the statistical significance of sequence comparisons (PNAS)
- Altschul et al. (1997) Gapped BLAST and PSI-BLAST (Nucleic Acids Research)
- The NCBI Handbook: BLAST Statistical Theory
- BLAST Documentation and Tutorials
These points provide quick orientation—use them alongside the full explanations in this page.