DNA / RNA / protein sequence tool

Sequence Alignment Tool

Paste two sequences and this tool computes the optimal alignment using Needleman-Wunsch (global) or Smith-Waterman (local) algorithms, showing you how similar they are and exactly where they differ. Supports DNA, RNA, and protein sequences.

🔒 Everything is computed right here in your browser (the alignment runs in a Web Worker, so the page never freezes while you type). Your sequence is never sent to or stored on a server.
Ad placement (to be added after Google AdSense approval)

What is sequence alignment?

Sequence alignment arranges two or more DNA, RNA, or protein sequences side by side to find which positions match, which differ, and where insertions or deletions (gaps) occur. When two sequences differ in length, gaps (-) must be inserted somewhere so the sequences line up as well as possible — and the number of possible alignments grows explosively as sequences get longer. This tool uses dynamic programming to always find the mathematically optimal alignment for the scoring scheme you choose.

Global vs. local alignment

  • Global alignment (Needleman-Wunsch): aligns both sequences from end to end. Best when the sequences are similar in length and you want to compare them in full — for example, comparing two alleles of the same gene, or verifying a recombinant plasmid sequencing result.
  • Local alignment (Smith-Waterman): finds only the most similar sub-region between the two sequences. Best when a short sequence (a primer, a protein domain) might appear somewhere within a much longer sequence, or when unrelated flanking sequence (vector backbone, adapters) surrounds the region you actually care about.

Why compare two sequences?

Pairwise sequence comparison comes up constantly in day-to-day molecular biology work.

  • Verifying sequencing results: quickly check whether a Sanger read or cloning result exactly matches an expected reference sequence, and exactly where it doesn't.
  • Detecting variants and mutations: compare wild-type and mutant sequences to pinpoint exactly where substitutions, insertions, or deletions occur.
  • Checking primer/oligo binding sites: use local alignment to see how well a designed primer matches a specific region of a target sequence.
  • Comparing orthologs and paralogs: examine conserved regions and differences between protein sequences from different species or gene families.

Scoring

An alignment algorithm needs a way to judge "which alignment is better." This tool uses an affine gap penalty, charging a different cost for opening a new gap versus extending an existing one — biologically, one longer gap is often more plausible than several short ones scattered around.

  • DNA/RNA: uses match and mismatch scores you set directly. Defaults are +1 for a match and -1 for a mismatch.
  • Protein: uses the BLOSUM62 substitution matrix, the default used by NCBI BLASTP and most protein aligners. Substitutions between chemically similar amino acids (e.g. L↔I) score positively even though they aren't identical, while substitutions between very different residues score negatively. The : symbol in the alignment marks these "similar but not identical" positions.
  • Gap open / gap extend: set the cost of opening a new gap and the additional cost of extending it by one more position. The defaults (10 / 0.5) follow the convention used by widely adopted tools such as EMBOSS.

Reading the identity score

Identity is the percentage of aligned positions that are exactly identical. If two sequences are the same length with zero gaps and 100% identity, they are exactly the same sequence; otherwise, a higher identity percentage means the sequences are more similar. In local alignment, identity is calculated only within the matched region that was found — any unaligned sequence before or after it is not counted.

How to use it

  1. Paste the two sequences you want to compare into the Sequence A and Sequence B boxes (plain sequence or FASTA with a > header both work; if multiple records are pasted, only the first one in each box is used).
  2. Choose the sequence type (auto-detect / DNA / RNA / protein) and alignment mode (global / local).
  3. Adjust the match/mismatch scores or gap penalties if needed.
  4. Review the identity, the alignment itself, and the list of differing positions, then copy or download the report.

Frequently asked questions

What is sequence alignment?

Sequence alignment arranges two or more sequences side by side to show which positions match, which differ, and where gaps need to be inserted. This tool finds the mathematically optimal alignment using the Needleman-Wunsch (global) and Smith-Waterman (local) algorithms.

What is the difference between global and local alignment?

Global alignment (Needleman-Wunsch) aligns both sequences from end to end. Local alignment (Smith-Waterman) finds only the most similar sub-region between the two sequences. Use global alignment when comparing sequences of similar length in full, and local alignment when checking whether a short sequence appears somewhere within a much longer one.

What is the difference between identity and similarity?

Identity is the percentage of aligned positions that are exactly the same character. Similarity applies only to protein sequences and additionally counts substitutions that are not identical but score positively under the BLOSUM62 matrix (chemically similar residues).

What scoring scheme is used for protein sequences?

Protein sequences are scored with the widely used BLOSUM62 substitution matrix. DNA/RNA sequences use match and mismatch scores that you can set yourself.

Is there a sequence length limit?

Yes — each sequence is limited to 2,000 characters so the alignment stays fast in the browser. The computation itself runs in a Web Worker in the background, so the page never freezes while you type.

Is my sequence data sent to a server?

No. All alignment computation happens locally in your browser using JavaScript. Nothing is transmitted to or stored on any server.