FASTQ Quality Score Calculator — Phred Q Score, Error Rate, Q20/Q30
The fourth line of a FASTQ file — that string of cryptic symbols — encodes quality scores. This tool does two things: converts between Q scores and error rates; parses a quality string into mean quality, ≥Q20/Q30 fractions, and expected error count.
A Q score is just a log-transformed error rate
The PHRED quality score has a one-line definition:
Q = −10 × log₁₀(Pe) Pe is the probability of a base-calling error
So every 10-point increase in Q drops the error rate by one order of magnitude:
| Q score | Error rate | Accuracy | Expected errors per 1000 bp |
|---|---|---|---|
| Q10 | 0.1 | 90% | 100 |
| Q20 | 0.01 | 99% | 10 |
| Q30 | 0.001 | 99.9% | 1 |
| Q40 | 0.0001 | 99.99% | 0.1 |
Metrics like “90% of bases ≥Q30” are common because Q30 corresponds to a 0.1% error rate, which is low enough for most applications.
Mean quality cannot be computed by averaging Q scores directly
This is the most common mistake — and the error is not small.
Q scores are logarithms. The arithmetic mean of logarithms has no physical meaning. To compute the mean quality of a read, you must convert each Q to an error rate, average the error rates, then convert back:
Correct: Q_mean = −10 × log₁₀( mean(Pe) )
Wrong: Q_mean = mean(Q)
How large is the difference? Take a read that is half Q40 and half Q20 (50 bases each):
| Method | Result |
|---|---|
| Arithmetic mean of Q scores | Q30.0 |
| Average over error rates | Q23.0 |
A difference of 7 Q units. Low-quality bases have very high error rates that dominate when averaging in error-rate space, while in the arithmetic mean of Q values each base counts equally.
More extreme: [Q40, Q40, Q40, Q10] gives an arithmetic mean of Q32.5, while the correct method yields only Q16.0 — a single Q10 base pulls the whole read’s mean quality down to Q16.
This is not pedantry: if you filter reads using the arithmetic mean, you will pass reads that actually carry many errors into downstream analyses.
Three mutually incompatible FASTQ encodings
Quality scores are stored as single ASCII characters, but three encodings have appeared historically, and they cannot be reliably distinguished automatically:
| Variant | Score type | ASCII offset | Score range |
|---|---|---|---|
| Sanger / Illumina 1.8+ / SRA | PHRED | 33 | 0 – 93 |
| Early Solexa / Illumina | Solexa | 64 | −5 – 62 |
| Illumina 1.3 – 1.7 | PHRED | 64 | 0 – 62 |
Note the middle row: early Solexa used Solexa scores, not PHRED scores:
Q = −10 × log₁₀(Pe / (1 − Pe)), which can be negative. The two score types converge at high quality but diverge at low quality — PHRED 10 corresponds to Solexa 9.5, while PHRED 2 corresponds to Solexa −2.3.
Data you encounter today is almost always Phred+33. Phred+64 only appears in data from before 2011.
About automatic encoding detection
This tool attempts to detect the encoding, but only reports a conclusion when it can be certain:
- A character with ASCII code below 64 → must be Phred+33;
- The highest character is above
J(74) → inferred as Phred+64, because Illumina 1.8+ caps Q values at about 41 (corresponding toJ); - Neither condition met → the tool tells you it cannot determine the encoding; please specify manually.
No guessing. Short reads or high-quality reads may fall entirely within the overlapping region of both encodings. A wrong guess shifts every Q value by 31 — worse than giving no answer at all.
Expected error count is more useful than mean quality
The “expected number of erroneous bases” in the output is the direct sum of all Pe values. Its meaning is straightforward: how many bases in this read are expected to be wrong.
Filtering reads by expected error count is more principled than by mean quality — mean quality is poorly comparable across reads of different lengths, whereas “expected number of wrong bases” is on the same scale at any read length. Long-read QC tools use this metric for exactly this reason.
Data sources
Encoding offsets and score ranges are taken from the Biopython Bio.SeqIO.QualityIO module source code, which follows the defining paper for the FASTQ format:
Cock PJA, Fields CJ, Goto N, Heuer ML, Rice PM (2010)
The Sanger FASTQ file format for sequences with quality scores, and the
Solexa/Illumina FASTQ variants. Nucleic Acids Research 38(6):1767–1771,
DOI 10.1093/nar/gkp1137.
PHRED–Solexa conversions have been verified point-by-point against Biopython’s solexa_quality_from_phred().
Related tools
To calculate sequencing depth and data volume, see Sequencing Coverage Calculator; for basic sequence statistics, see Sequence Basic Statistics.
FAQ
What does Q30 actually mean?
Q30 means the probability of a base-calling error is 0.001 — one in a thousand — giving 99.9% accuracy. '90% of bases ≥Q30' means 90% of bases in the dataset reach or exceed Q30. Every 10-point increase in Q reduces the error rate by one order of magnitude: Q20 is 1%, Q30 is 0.1%, Q40 is 0.01%.
Why can't you compute mean quality by averaging Q scores directly?
Because Q is a log transform of error rate, and the arithmetic mean of logarithms has no physical meaning. The correct approach is to convert each Q to an error rate, average the error rates, then convert back to Q. The difference is substantial: a read that is half Q40 and half Q20 gives Q30.0 by arithmetic mean but only Q23.0 by the correct method. Low-quality bases have very high error rates that dominate when averaging in error-rate space, but count as just another term in the arithmetic mean of Q values.
Why can't the tool determine the encoding of my quality string?
Because the character ranges of the two encodings genuinely overlap. The encoding can only be determined when a character with ASCII code below 64 appears (must be Phred+33), or when the highest character exceeds J (74, essentially impossible under Phred+33). When the string falls in the overlapping region, the tool tells you so and asks you to specify manually — rather than guessing, which would shift all Q values by 31.
Will I ever encounter Phred+64 data today?
Rarely. Illumina switched to Phred+33 from version 1.8 onward, and data in SRA is uniformly Phred+33. You will only encounter Phred+64 when processing data from before 2011 or certain legacy pipeline intermediates. Even older is Solexa encoding, which uses an entirely different scoring formula.
What is the difference between Solexa scores and PHRED scores?
PHRED uses Q = −10·log₁₀(Pe); Solexa uses Q = −10·log₁₀(Pe/(1−Pe)), which can be negative, with a minimum of −5. The two converge at high quality (PHRED 30 ≈ Solexa 30) but diverge at low quality: PHRED 10 corresponds to Solexa 9.5, and PHRED 2 corresponds to Solexa −2.3. Reading Solexa data as PHRED will systematically misestimate low-quality base scores.
How do I use the expected error count?
It is the direct sum of all per-base error probabilities for the read — meaning 'how many bases are expected to be wrong.' Filtering by expected error count is more principled than by mean quality: mean quality is hard to compare across reads of different lengths, whereas 'expected number of wrong bases' is on the same scale regardless of read length. Long-read QC tools widely adopt this metric.
Does this tool upload my data?
No. All computation runs in your browser; the quality string never leaves your machine. Note that FASTQ files are typically very large — this tool is designed for spot-checking individual reads. For whole-file quality control, use a local tool such as FastQC.
Related tools
DNA / RNA Reverse Complement Online Converter
Paste a sequence to get its reverse complement, complement, or reverse; supports FASTA input and IUPAC degenerate bases.
Online DNA GC Content and Tm Calculator
Calculate GC%, base composition, molecular weight, and two empirical Tm values — for rapid primer screening.
DNA to Protein Translation — Six-Frame Online Tool
Standard genetic code (NCBI table 1): single-frame or six-frame translation with ORF finder.
Buy me a coffee