Sequence identity and similarity calculator

Paste aligned sequences, plain text or FASTA. Identity and similarity as you type.

Result

| identical : similar . mismatch   gap

What is the difference between sequence identity and similarity?

Sequence identity is the fraction of alignment columns in which two sequences carry exactly the same residue. Sequence similarity is broader: it also counts columns where the residues differ but are chemically alike, such as leucine against isoleucine or aspartate against glutamate. Similarity is only meaningful for proteins, because nucleotides have no conservative substitutions, so for DNA and RNA the calculator reports identity alone. Similarity is always equal to or higher than identity for the same pair.

How is percent identity calculated?

identity % = identical columns ÷ alignment length × 100
similarity % = (identical + similar columns) ÷ alignment length × 100

The alignment length is the number of columns including those with gaps. This is the convention used by BLAST, where identity is reported over the aligned region. Other tools divide by the length of the shorter sequence or by the number of gap-free columns, which gives a higher number for the same alignment. The identical, similar and gap counts are shown so you can recompute under any convention.

Worked example. Two aligned DNA sequences of 20 columns with 17 identical columns, 2 mismatches and 1 gap column: 17 ÷ 20 × 100 = 85.0 % identity.

How are gaps counted?

A column that has a gap character (- or .) in either sequence is a gap column. It is neither identical nor similar, but it stays in the denominator, so gaps lower both percentages. Columns where both sequences have a gap, which can occur in a multiple alignment, are counted as gap columns too. The sequences must have the same length once gaps are included; pairs of different length are skipped and reported.

Which amino acids count as similar?

Two residues are similar when their BLOSUM62 score is positive, the rule BLAST uses for its "Positives" column. In practice this groups hydrophobic residues (I, L, V, M), aromatics (F, Y, W), acidic (D, E), basic (K, R, H in part), amides (N, Q) and small polar residues (S, T, A in part). Identical residues always score positive, so every identity is also a similarity.

Comparing more than two sequences

With three or more aligned sequences the calculator compares every pair and lists them in a table with identity, similarity and gap counts for each. The headline numbers are the average over all pairs. This is a quick way to spot the odd sequence out in a family alignment or to check that orthologues fall in the expected identity range.

When to use an identity calculator

  • Homology thresholds. Above roughly 30 % identity over 100 or more residues, two proteins are almost certainly homologous; below that, the "twilight zone" begins.
  • Species and strain typing with 16S rRNA or marker genes, where 97 to 99 % identity cut-offs separate operational taxonomic units.
  • Primer and probe checks against off-target sequences.
  • Reporting percent identity for a pairwise alignment made with theNeedleman–Wunsch orSmith–Waterman tools.

Frequently asked questions

What is the difference between sequence identity and similarity?

Identity counts alignment columns where the two residues are exactly the same. Similarity also counts columns where the residues differ but are physicochemically related, such as leucine and isoleucine or aspartate and glutamate. Similarity is therefore always equal to or higher than identity, and it only applies to protein sequences.

How is percent identity calculated?

Percent identity is the number of identical columns divided by the length of the alignment, multiplied by 100. The calculator uses the full alignment length, including columns that contain a gap, as the denominator, which is the convention used by BLAST.

Do gaps count against identity?

Yes. A column with a gap in either sequence is neither identical nor similar, but it stays in the denominator, so every gap lowers the percentage. The number of gap columns is reported separately so you can recompute identity over gap-free columns if you prefer that convention.

Which residues count as similar?

Two amino acids are similar when their BLOSUM62 substitution score is positive, the same rule BLAST uses for its "Positives" value. Examples are I/L/V/M, F/Y/W, D/E, K/R, S/T and N/Q.

Do the sequences have to be aligned first?

Yes. The calculator compares sequences column by column, so they must come from an alignment and have the same length once gaps are included. Align them first with a pairwise or multiple alignment tool and paste the aligned FASTA here.