What N50 measures and which data count
For a nonempty set of positive integer contig lengths in consistent units. Specify the inclusion cutoff and whether objects are contigs or scaffolds before comparison. N50 uses the included assembly length; NG50 uses a separately specified genome size. The calculator handles exactly five contigs of 1 through 1012 bp each, not a FASTA file or arbitrary assembly list.[1][2]
A contig is a contiguous assembled sequence. Scaffolds can connect multiple contigs across gaps. Report the object type, minimum included length and total length. N50 from filtered contigs is not automatically comparable with unfiltered scaffold N50. All example values below are original calculation data, not measurements from an organism.[3]
The first reached half-length threshold decides
- Select the included contigs, convert every length to bp and sort descending as L(1)≥…≥L(n).
- Sum the lengths to Ltot. The N50 threshold is Ltot/2; an odd base count can give a noninteger threshold.
- Form prefix sums Sk and find the smallest k with 2Sk≥Ltot. Equality suffices; the preceding sum satisfies 2Sk−1<Ltot.
- Read N50=L(k) as a length and L50=k as the minimum contig count. Also report Ltot and the inclusion filter.
The condition “at least half lies in contigs of this length or longer” is not unique without the greatest-length or first-threshold rule. In the starting example, 4 kb and 3 kb also satisfy that inequality, yet N50 remains 7 kb. The procedure defines a length-weighted summary; it is not a biological growth law.[1]
Two fully worked examples
N50 differs from mean and median
- Given
- Original calculation: five contigs of lengths 9, 6, 4, 3 and 2 kb; include all five.
- Find
- Find N50, L50 and total assembly length, then compare them with ordinary summaries.
The list is already descending. Symbolically Ltot=ΣLi; here Ltot=9+6+4+3+2=24 kb.
The first contig contributes 9 kb; the first two contribute 15 kb. Since 9<12≤15, the first qualifying index is k=2.
The last added contig is 6 kb long, giving N50=6 kb and L50=2. The median contig length is instead 4 kb, and the arithmetic mean is 24/5=4.8 kb.
Result: N50=6 kb, L50=2 and Ltot=24 kb. These summaries answer different questions.
Check: The two longest contigs contain 15/24=62.5% of the bases. The longest alone contains 9/24=37.5% and does not suffice.
Exactly half and tied contig lengths
- Given
- Original calculation: contig lengths 6, 4, 4, 4 and 2 kb.
- Find
- Check the equality rule and the minimum count L50.
Total assembly length is 20 kb, so its half is 10 kb.
The prefix sums begin at 6 and 10 kb. The second contig reaches the threshold exactly, so the ≥ rule stops there.
N50 is 4 kb and the minimum L50 is 2. Four contigs are at least 4 kb long, but only the first two are needed to reach half.
Result: N50=4 kb, L50=2. With ties, L50 is the first qualifying prefix index, not automatically the count of all contigs ≥N50.
Check: Before that step only 6/20=30% is included; afterward exactly 50%. Another tied contig must not increase the minimum count.
Recall the method later with the formula’s flashcards.
10 flashcards · English materials
Already have an account? Sign in for flashcardsAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
A high N50 does not establish assembly correctness
A false join can lengthen a sequence and increase N50. Removing short contigs can also shrink the reference total and change the statistic. Neither automatically improves completeness, base accuracy or structural correctness. Also examine contamination, missing or duplicated regions and independent sequence support. No universally good N50 value is independent of genome size and the study objective.[3]
The bounded calculator does not read sequence files or detect biological errors. It computes N50, minimum L50 and total length solely from five entered contig lengths. It rejects zero, negative values, fractional bp and lengths above 1012 bp. The native step graphic represents discrete contigs; positions between integer contig counts do not imply extra biological objects.
Five varied exercises with solutions
Calculate · Foundation
Contig lengths: 8, 7, 4, 3 and 3 kb. Find N50 and L50.
Show hint
Halve the total and add the longest contigs first.
Learning goal: Find N50 from five contig lengths
Show solution and calculation
Ltot=25 kb and the threshold is 12.5 kb.
Prefix sums are 8 and 15 kb, giving N50=7 kb and L50=2.
The first prefix is below and the second above the threshold.
Rearrange · Application
The 50% threshold is 18 kb. What is Ltot, and does that also determine N50?
Show hint
The threshold equals Ltot/2; N50 also needs the contig lengths.
Learning goal: Separate total length from missing distribution information
Show solution and calculation
Ltot=2·18=36 kb.
N50 is not determined: lengths 18, 9, 4, 3 and 2 kb give N50=18 kb, whereas 12, 10, 6, 5 and 3 kb give N50=10 kb with the same total.
Interpret · Application
For 9, 6, 4, 3 and 2 kb, the median is 4 kb and N50 is 6 kb. Why is that consistent?
Show hint
The ordinary median counts each contig once; N50 weights by length.
Learning goal: Understand weighting by bases
Show solution and calculation
The median splits the list by contig count.
N50 follows cumulative bases: the 9- and 6-kb contigs together contain 15 of 24 kb, more than half.
These different weightings need not give the same result.
Error analysis · Application
For 10, 5, 3, 1 and 1 kb, a strict “more than half” rule gives N50=5 kb. Correct the error.
Show hint
At least half suffices.
Learning goal: Handle equality at the threshold
Show solution and calculation
Total assembly length is 20 kb.
The 10-kb contig alone reaches exactly 10 kb, or 50%.
Correct results are N50=10 kb and L50=1.
The error was using > instead of ≥.
Transfer · Challenge
From lengths 8, 6, 5, 4 and 3 kb, remove the three shortest contigs. How do N50 and Ltot change, and does this prove higher quality?
Show hint
Recalculate the N50 threshold after filtering.
Learning goal: Separate filtering effects from genuine improvement
Show solution and calculation
Initially Ltot=26 kb, the threshold is 13 kb and N50=6 kb.
After filtering, 8 and 6 kb remain: Ltot=14 kb, threshold 7 kb and N50=8 kb.
N50 rises without adding bases; 12 kb were excluded.
This proves neither completeness nor correctness.
The two-contig list is a hand calculation outside the five-contig calculator.
Check your understanding with the formula’s reference test.
8 test questions · English materials
Already have an account? Sign in for the testAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
The right next metric
Mean sequencing depth describes sequenced bases relative to genome size. That differs from the length of contiguous assembly pieces.
GC content adds a composition check. A similar proportion of G and C no more proves correct sequence arrangement than N50 does.
Sequence alignment and identity help compare corresponding sequence positions; N50 contains no such information.
Sources for this explanation
Quanta · Updated November 9, 2026
- International Human Genome Sequencing Consortium (2001): Initial sequencing and analysis of the human genome, p.871, N50 definition
- QUAST: N50.py — N50_and_L50 and NG50_and_LG50
- Ekblom, R. and Wolf, J.B.W. (2014): A field guide to whole-genome sequencing, assembly and annotation — Assembly evaluation
Editorial responsibility: Quanta Study editorial team
Review scope
This explanation, 2 worked examples and 5 exercises are available in German and English. Structure, source references and mathematical notation undergo automated checks. Calculations, model assumptions and both language versions receive a separate AI review.
An independent, named human subject review has not yet been documented. Our exercise numbers are worked examples, rather than measurements published by the cited sources.
Editorial responsibility, sources and methodsChange history
- Clarified the N50 definition and added complete DE/EN examples, threshold cases, five learning tasks and limits of assembly assessment.
Cite this reference page
Quanta. N50 contig length in a genome assembly. Updated November 9, 2026. https://quanta-study.de/en/formula-sheet/n50-genomassemblierung
When citing a specific scientific statement, also cite the specialist source linked to that statement.