Study and Productivity

How to Align DNA and Protein Sequences and Read the Result

Run global, local and multiple sequence alignments, colour residues, read percent identity and export an alignment figure in your browser.

Saizul Amin
Saizul Amin2 Nov 2026 · 3 min read
How to Align DNA and Protein Sequences and Read the Result

Sequence alignment lines up DNA or protein sequences so that matching positions sit in the same column. It is how biologists compare a clone with its reference, find conserved residues across species and see where a mutation falls. The free DNA and Protein Sequence Alignment Viewer aligns sequences in your browser, colours the result and calculates identity. This guide explains the methods and how to read the output.

Step 1: prepare FASTA sequences

FASTA format is a line starting with > and a short name, followed by the sequence. Keep names brief so they fit in the left column. Use only DNA or only protein in one alignment; the tool detects proteins automatically.

Step 2: choose the method

For two sequences, global alignment with the Needleman–Wunsch algorithm aligns them end to end, which suits sequences of similar length such as two versions of a gene. Local alignment with Smith–Waterman finds the best matching region, which suits a short read inside a long reference. For three or more sequences, the centre-star method picks the sequence most similar to all others and aligns the rest to it.

Step 3: set the scoring

For DNA, set a positive score for a match and negative penalties for mismatches and gaps. A larger gap penalty produces fewer, longer gaps. For proteins, the BLOSUM62 matrix scores each substitution by how often it occurs in related proteins, so a swap between similar amino acids such as leucine and isoleucine is penalised less than a swap between very different ones.

Step 4: read the alignment

Each block shows the names, the aligned sequences and a consensus line. Colouring by residue class makes conserved patterns visible: hydrophobic, positive, negative and polar residues each have their own colour. The matches-consensus colour highlights only residues that agree with the majority. Gaps show insertions or deletions.

Practical example

The sample loads three beta-globin protein sequences of 147 residues each. Aligning them gives 147 columns, with 62.6 percent of columns identical in all three. The identity matrix shows human and mouse are 81.0 percent identical, human and chicken 69.4 percent and mouse and chicken 66.0 percent, matching the expectation that the two mammals are closer to each other than either is to the bird.

Step 5: use the identity matrix

The identity matrix compares every pair of sequences. Identity counts identical residues over columns where at least one sequence has a residue, so gaps lower the score. Shading helps spot clusters of similar sequences.

Step 6: export

Download the alignment as aligned FASTA, Clustal with conservation stars, the consensus sequence, or an SVG figure with coloured blocks for slides and papers.

When to use other tools

The centre-star method works well for closely related sequences. For many sequences or distant relatives, use a dedicated multiple aligner and then open its output here with the already aligned option to colour and export it.

Common pitfalls

Do not mix DNA and protein sequences. For coding sequences that are distantly related, translate them and align the proteins, because protein similarity is preserved over longer evolutionary distances than DNA similarity. Remember that percent identity depends on how gaps are counted, so state your method when you report it.

Teaching with alignments

Alignment is easiest to understand by experiment. Change the gap penalty and watch gaps merge or split, or switch between global and local mode on a short read and a long reference. Students quickly see why scoring choices matter.

Privacy

Sequences are aligned in your browser and are not uploaded.

Summary

Prepare FASTA, choose global, local or multiple alignment, read colours, consensus and identity, and export with the alignment viewer.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages