How to run an alignment 01 Paste the two sequences. Raw letters or FASTA; whitespace and digits are ignored. 02 Choose global or local. Global aligns both sequences end to end; local finds the best-scoring island and ignores the rest. 03 Pick a scoring matrix. BLOSUM62 for proteins, a match/mismatch DNA matrix for nucleotides; the matrix name and source are printed under the result. 04 Set the gap costs. Opening cost for the first gap position, extension for each additional one; the affine cost of a k-residue gap is open + (k−1)·extend. 05 Read the cards and the text block. Score, identity, similarity and gaps sit above the formatted alignment, where | marks identity, + a conservative substitution and - a gap.
Worked example The DNA demo pair GCATGCG against GATTACA with the DNA1/−1 matrix, gap open 1, gap extend 1:
Mode
Score
Alignment
Identity
Gaps
Global
0
GCA-TGCG / G-ATTACA
50% (4/8)
25%
Local
2
CA / CA
100% (2/2), A range 2–3 , B range 6–7
0%
Global must pay for the ends: two gaps spread through the middle to keep G, C and CA aligned, and the score lands at zero. Local simply reports the two-base CA island at 2 . The protein textbook pair shows the same split with biology attached. BLOSUM62 with the standard open 11 , extend 1 gives global score 2 — HEAGAWGHEE over ---PAWHEAE, 30% identity — while local finds HEA against HEA for score 17 at 100% identity, B range 4–6 . Switch to the panel's BLOSUM50 with open 8 , extend 8 and the global alignment changes completely: score 1 , HEAGAWGHE-E over --P-AW-HEAE, 45.4545% identity, the gaps now spread as 45.4545% of the alignment.
Score defines best; the matrix defines score Every alignment is a path through a grid: match a residue pair, or consume one residue against a gap. Needleman–Wunsch scores paths from corner to corner, so it answers "given that these are the whole sequences, what is the best pairing?"; Smith–Waterman lets the score restart at zero and takes the best cell anywhere, so it answers "what is the best shared piece?" Both use the same recurrence, differing only in boundary conditions. The scoring matrix decides what a match is worth: BLOSUM62 was built from substitution frequencies in conserved protein blocks, units of half a bit, so a conservative swap such as I to V scores +3 rather than a penalty. DNA matrices are simpler identity rules with positive matches and negative mismatches. The affine gap model recognises that one long insertion is more likely than many scattered single gaps, so it charges an opening cost once and a smaller extension cost per extra position. Similarity counts pairs whose score is positive, so for DNA matrices it equals identity, while BLOSUM's positive scores push similarity above identity — ILV against VLI scores 10 with only 33.333% identity but 100% similarity.
Limits and what it does not do
A pairwise bench, not a search engine. It aligns two sequences you supply; it does not scan a database, estimate E-values or correct for multiple comparisons, so a score cannot be read as significance.
The score is only as biological as the matrix and penalties. There is no free lunch: opening and extension costs are inputs, and the printed method line is the honest label for the result. What it does not do. It does not build a multiple alignment or a phylogenetic tree, and it stops above 4,000,000 dynamic-programming cells — roughly 2,000 × 2,000 residues — to keep the page responsive. For database search use NCBI BLAST , for many sequences Clustal Omega , for the composition and melting of a single sequence the Sequence & Tm panel , for its six reading frames the Translation & ORF panel , and for residue-level properties the Protein panel .
The trap: the same pair, three answers There is no single true alignment. HEAGAWGHEE against PAWHEAE produces global score 1 under BLOSUM50/open 8 and score 2 under BLOSUM62/open 11 — both optimal for their own scoring scheme. And a high score is not evidence of homology: identity of 100% on a two-residue local island is a statement about two letters, not two genes. Report the matrix, the gap costs and the mode with every score, or the number means nothing. When extension costs more than opening, the engine warns that the model prefers many short gaps — the affine model inverted.
Where it is used Checking a construct or a primer Align a designed insert against the parent vector to see which bases pair and where the gaps fall.
Teaching scoring schemes Run one pair through the DNA and BLOSUM matrices and watch the path move; the identity and similarity cards explain why a protein alignment can score well without matching letters.
Privacy The dynamic-programming matrices are computed in your browser; the sequences you paste are never uploaded or stored.
References
Needleman & Wunsch, A general method applicable to the search for similarities in the amino acid sequence of two proteins (1970). pubmed.ncbi.nlm.nih.gov (访问日期:2026-10-07)
Smith & Waterman, Identification of common molecular subsequences (1981). pubmed.ncbi.nlm.nih.gov (访问日期:2026-10-07)
Henikoff & Henikoff, Amino acid substitution matrices from protein blocks (1992). pubmed.ncbi.nlm.nih.gov (访问日期:2026-10-07)
NCBI, BLAST substitution matrices . ftp.ncbi.nih.gov (访问日期:2026-10-07)
Wikipedia, Sequence alignment — global, local and affine gap models. en.wikipedia.org (访问日期:2026-10-07)
Calculators in this hub
Hand-picked tools, one click away. The mini versions compute live and carry your values into the full calculator.
Sources & review
Reviewed by CalcX Editorial Team
Updated 2026-10-07