MAFFT
v7.526Align protein or nucleotide sequences with selectable accuracy and speed trade-offs.
MAFFT (Multiple Alignment using Fast Fourier Transform) is a multiple sequence alignment program that aligns protein or nucleotide sequences to identify conserved regions and evolutionary relationships. It offers a range of algorithms that trade off between speed and accuracy, from ultra-fast progressive methods for thousands of sequences to highly accurate iterative methods for smaller datasets.
The hosted tool runs MAFFT 7.526 and returns the alignment, native diagnostics, and any requested supporting files.
MAFFT's distinctive feature is its use of Fast Fourier Transform to rapidly identify homologous regions between sequences, dramatically reducing computation time compared to traditional dynamic programming approaches. For alternative alignment approaches, see Clustal Omega which uses HMM-based profile alignment.
The credit calculator has a five-credit minimum. The exact quote is calculated before submission from the submitted content. For FASTA, headers, gaps, dots, and whitespace do not count toward the residue total.
| Total residues | Credits per run |
|---|---|
| 100 | 6 |
| 1,000 | 11 |
| 10,000 | 35 |
These examples use Align sequences, two ungapped FASTA records, and no additional inputs. The chosen algorithm, iteration count, output format, and optional downloads do not apply a separate price multiplier. Additional sequence, seed, or custom text files can increase the quote. Batch entries are quoted as separate runs, and plan limits still apply.
Each active input accepts pasted text or one uploaded file, with a 50 MiB limit per uploaded file. FASTA inputs accept .fasta, .fa, .fas, and .txt; custom files accept .txt.
| Input | Available mode | Requirement |
|---|---|---|
Sequences (sequences) | All modes | Required multi-FASTA containing at least two records; an existing alignment in addition modes. |
Sequences or profile to add (additional_sequences) | add, addfragments, addfull, addlong, addprofile | Required second multi-FASTA with at least one record; addprofile requires an aligned profile that meets MAFFT's cluster constraints. |
Seed alignments (seed_alignments) | seed | Required aligned multi-FASTA with at least one record; one seed file per run. |
Scoring matrix (scoring_matrix) | context | Optional matrix in MAFFT's native amino acid matrix format; applicable to protein alignment. |
Guide tree (guide_tree) | context | Optional numbered merge table in MAFFT tree-input format. |
Anchors (anchors) | context | Optional native anchor table. |
Alignment merge table (merge_table) | context | Optional native table identifying groups of aligned sequences to merge. |
Custom file contents are passed unchanged to MAFFT. The tree input is a numbered merge table, not arbitrary Newick text. Native validation checks file syntax and compatible combinations. Empty FASTA records count toward the record minimum; MAFFT determines their alignment behavior.
MAFFT converts amino acid sequences into numerical representations based on volume and polarity, then uses FFT to rapidly compute correlations between sequences. This identifies conserved regions that serve as anchors, restricting the search space for subsequent dynamic programming alignment.
Traditional sequence comparison requires operations for two sequences of length using dynamic programming. MAFFT reduces this by converting sequences to waves based on physicochemical properties:
Each residue is represented as a 2D vector of volume and polarity values. The correlation between two sequence waves can be computed in time using FFT. Peaks in the correlation identify conserved regions that become anchors for alignment.
MAFFT offers two fundamental strategies:
Progressive methods (FFT-NS-1, FFT-NS-2) build a guide tree from pairwise distances and align sequences following the tree order. FFT-NS-2 improves on FFT-NS-1 by rebuilding the guide tree from the initial alignment before a second pass.
Iterative refinement methods (L-INS-i, G-INS-i, E-INS-i) start with a progressive alignment, then repeatedly refine it. Each iteration divides the alignment into two groups and realigns them, continuing until the score stops improving.
The iterative methods incorporate consistency scores derived from all pairwise alignments. If residues A-B are aligned in sequence pair 1-2, and B-C are aligned in pair 2-3, consistency suggests A-C should align in pair 1-3. This transitive information improves accuracy for divergent sequences.
MAFFT provides multiple algorithms optimized for different scenarios. Choosing the right one depends on your dataset size and accuracy requirements.
Uses local pairwise alignment (Smith-Waterman) with iterative refinement. Best for sequences containing a single alignable domain with flanking regions. The flanking sequences are effectively ignored during alignment.
We recommend L-INS-i for smaller datasets where accuracy is paramount. In Auto mode, MAFFT selects full L-INS-i only when there are fewer than 100 sequences and the longest sequence is under 3,000 residues; larger inputs progressively use lighter strategies according to sequence count and maximum length.
Uses global pairwise alignment (Needleman-Wunsch) with iterative refinement. Assumes the entire sequence length should be aligned, making it suitable for full-length protein domains without terminal extensions.
Use G-INS-i when you know your sequences are globally homologous from end to end.
Uses generalized affine gap costs, allowing long internal gaps without excessive penalty. Designed for sequences with conserved motifs embedded in variable-length regions.
E-INS-i is the most versatile option when you're uncertain about sequence structure. It handles cases where both L-INS-i and G-INS-i might struggle.
A progressive method that builds the guide tree twice: once from 6-mer distances, once from the initial alignment. Much faster than iterative methods with reasonable accuracy.
Use FFT-NS-2 for datasets of 500-10,000 sequences where speed matters more than maximum accuracy.
Uses tree-based clustering for initial distance estimation, enabling alignment of tens of thousands of sequences. Accuracy is lower than other methods but computation remains tractable.
Use PartTree only for datasets exceeding 10,000 sequences where other methods are too slow.
MAFFT auto-detects whether sequences are protein or nucleotide by examining character composition. Manual selection is useful for ambiguous cases like very short sequences.
DNA and RNA both select MAFFT's native nucleotide mode (--nuc). They use the same alignment scoring and input restrictions here. Protein selects --amino; Auto lets MAFFT detect the sequence type.
-. Compatible with FastTree and most downstream tools.The advanced groups start collapsed. Numeric overrides are text fields: integer values use whole-number strings, and other numbers use signed decimal strings without scientific notation. Optional means blank, which leaves the selected method's native value in place. Likewise, native adds no override. MAFFT decides how a preset and explicit controls interact; its log records warnings or rejected combinations. The hosted thread count is fixed at two, with a nine-minute native execution limit.
| Parameter | Type | Default | Description |
|---|---|---|---|
Algorithm (algorithm) | enum | auto | auto, linsi, ginsi, einsi, fftns2, parttree, native_default, fftns1, fftnsi, nwns2, nwnsi, or dpparttree. These correspond to the named algorithms above and their FFT, non-FFT, or PartTree variants. Native default adds no algorithm preset. |
Sequence type (sequence_type) | enum | auto | auto, Protein, DNA, or RNA; DNA and RNA both select nucleotide mode. |
Output format (output_format) | enum | fasta | fasta, clustal, or phylip. |
Output order (output_order) | enum | input | input preserves submitted order; aligned uses MAFFT's reordered output. |
Alignment mode (alignment_mode) | enum | align | align, add, addfragments, addfull, addlong, addprofile, seed, or context; activates the corresponding inputs above. |
Job name (jobName) | string | optional | Optional run label; does not change the alignment. |
| Parameter | Type | Default | Description |
|---|---|---|---|
Maximum iterations (maxiterate) | string | optional | Integer refinement ceiling; 0 requests no iterative refinement. The L-INS-i, G-INS-i, and E-INS-i presets request 1000 before any explicit override. |
Tree rebuilding cycles (retree) | string | optional | Integer number of guide-tree rebuilding cycles. |
Random seed (randomseed) | string | optional | Integer seed for native randomized operations. |
PartTree partitions (partsize) | string | optional | Integer partition-size control for PartTree or DP PartTree. |
PartTree group size (groupsize) | string | optional | Integer group-size control for PartTree or DP PartTree. |
FFT (fft_mode) | enum | native | native, fft to force FFT, or nofft to disable it. |
Memory strategy (memory_mode) | enum | native | native, memsave, or nomemsave. |
Pairwise method (pair_method) | enum | native | native, 6merpair, 10merpair, localpair, globalpair, genafpair, multipair, 6mermultipair, or 10mermultipair. |
Guide tree method (tree_method) | enum | native | native, averagelinkage, minimumlinkage, pileup, randomchain, or large. |
Mixed linkage weight (mixedlinkage) | string | optional | Decimal mixing weight; MAFFT requires a value from 0 to 1. |
Skip iterative score calculation (noscore) | boolean | false | Requests omission of iterative score calculation; native method and threading restrictions still apply. |
Penalty values retain their native signs and scoring scale. Lowercase and uppercase names identify different parameters. The matrix controls select native model families; incompatible choices are checked by MAFFT.
| Parameter | Type | Default | Description |
|---|---|---|---|
Gap opening penalty (op) | string | optional | Decimal gap-opening penalty. |
Offset (ep) | string | optional | Decimal scoring offset. |
Local gap opening penalty (lop) | string | optional | Decimal gap-opening parameter for local pairwise alignment. |
Local offset (lep) | string | optional | Decimal local pairwise scoring offset. |
Local gap extension penalty (lexp) | string | optional | Decimal local pairwise gap-extension parameter. |
Generalized affine gap opening penalty (LOP) | string | optional | Decimal generalized affine gap-opening parameter. |
Generalized affine extension penalty (LEXP) | string | optional | Decimal generalized affine gap-extension parameter. |
Gap extension penalty (exp) | string | optional | Decimal gap-extension penalty. |
Pairwise gap opening penalty (opdist) | string | optional | Decimal gap-opening penalty for pairwise distance calculations. |
Consistency weight (weighti) | string | optional | Decimal weight for pairwise consistency information. |
Shift penalty (shiftpenalty) | string | optional | Decimal shift factor; MAFFT rejects values below 1. Values below 100 require globalpair, consistency weight of at least 1, and a mode other than addfragments. |
Unalignable-region level (unalignlevel) | string | optional | Decimal value from 0 to 1; positive values require globalpair with consistency weight of at least 1 and are incompatible with addfragments and PartTree. |
BLOSUM matrix (bl) | string | optional | Integer BLOSUM matrix number; native validation determines supported matrices. |
JTT PAM distance (jtt) | string | optional | Integer PAM distance for the JTT amino acid model. |
Transmembrane PAM distance (tm) | string | optional | Integer PAM distance for the transmembrane amino acid model. |
Nucleotide PAM distance (kimura) | string | optional | Integer PAM distance for nucleotide scoring. |
Transition/transversion ratio (kappa) | string | optional | Decimal nucleotide transition/transversion ratio. |
Terminal margin (terminalmargin) | string | optional | Integer native terminal-margin control for addition alignment. |
Use observed residue frequencies (fmodel) | boolean | false | Requests observed residue frequencies for the substitution model. |
Penalize terminal gaps (termgappenalty) | boolean | false | Requests terminal-gap penalties. |
Preserve gappy regions (leavegappyregion) | boolean | false | Requests MAFFT's legacy gap handling for gappy regions. |
Allow shifts (allowshift) | boolean | false | Requires globalpair and consistency weight of at least 1; incompatible with addfragments. When enabled, omitted unalignlevel and shiftpenalty become 0.8 and 2.0. |
Disable sequence weighting (unweight) | boolean | false | Requests unweighted sequences. |
| Parameter | Type | Default | Description |
|---|---|---|---|
Nucleotide direction (direction) | enum | native | native keeps submitted direction; adjustdirection or adjustdirectionaccurately requests nucleotide orientation adjustment. |
Accept unusual symbols (anysymbol) | boolean | false | Requests MAFFT's acceptance of unusual symbols. |
Preserve letter case (preservecase) | boolean | false | Preserves uppercase/lowercase letters; native handling also permits unusual symbols. |
Treat N as a wildcard (nwildcard) | boolean | false | Requests nucleotide N wildcard handling. |
Maximum ambiguous fraction (maxambiguous) | string | optional | Decimal fraction from 0 to 1; native filtering can remove records and return an excluded-sequences file. |
| Parameter | Type | Default | Description |
|---|---|---|---|
Include operational guide tree (output_guide_tree) | boolean | false | Requests the guide tree used for alignment. |
Distance matrix (distance_output) | enum | none | none, distout for native MAFFT hat2, or distoutclustalo for Clustal-style distances. |
Added-sequence mapping (mapping_output) | enum | none | none, mapout for a full position map, or compactmapout for a compact insertion map; available only in add, addfragments, addfull, and addlong. Either map option also keeps the reference alignment length. |
Keep reference alignment length (keeplength) | boolean | false | Available only in add, addfragments, addfull, and addlong; removes inserted columns from the added sequences. |
Output line length (linelength) | string | optional | Integer native output line length; 0 is rejected by MAFFT. |
Clustal name length (namelength) | string | optional | Integer sequence-name width passed to MAFFT's output formatter; shortened names may be repeated. |
The MSA viewer displays aligned records. The Files tab contains the alignment, native log, and any supporting files produced by the selected settings or mode. File contents retain MAFFT's native output.
| Download | When produced | Contents |
|---|---|---|
Alignment (.fasta, .aln, or .phy) | Every successful run | Aligned sequences in the selected format and order. |
Diagnostic log (.log) | Every successful run | Native version, selected strategy, progress, and warnings. |
Operational guide tree (.tree) | Requested by output_guide_tree | Newick guide tree used for alignment; not an inferred phylogeny. |
Distance matrix (.hat2 or .clodist) | Requested by distance_output | Native MAFFT or Clustal-style pairwise distances. |
Added-sequence map (.map) | Requested by mapping_output | Full position correspondence or compact insertion mapping. |
Merge guide tree (GuideTree) | Produced by a merge operation | Native merge-tree file. |
Excluded sequences (.notused) | Produced by ambiguity filtering | FASTA records removed by native filtering. |
The summary's sequence count is the number of returned alignment records, so addition, seed, or filtering modes can change it. Alignment length is the number of output columns. The requested algorithm and effective native strategy can differ in Auto mode; the log records the actual strategy.
Choose Add sequences, Add fragments, Add full-length sequences, Add long sequences, or Add an aligned profile to supply a second multi-FASTA file alongside your existing alignment. MAFFT handles each mode's constraints, including the cluster requirement for an aligned profile. The existing alignment must contain at least two records.
Keep reference alignment length removes insertions in added sequences. A full position map or compact insertion map also enables this behavior. Mapping files show how added positions correspond to the original alignment; deleted insertions remain recorded. See the MAFFT addition documentation for examples.
Use seed alignments accepts an aligned multi-FASTA seed file. Use custom alignment files accepts an amino acid scoring matrix, a MAFFT-format tree input, an anchor file, and an alignment merge table. These files are passed unchanged to MAFFT. A tree input uses MAFFT's native numbered merge format, rather than arbitrary Newick; see the tree input documentation.
Expand the controls to set iteration counts, tree rebuilding, scoring matrices, gap penalties, FFT, pairwise methods, memory strategy, nucleotide direction, or ambiguity handling. Blank numeric controls retain the selected method's native defaults. Explicit values are passed to MAFFT, which checks combinations and reports warnings in the log.
Optional downloads include the operational guide tree, native pairwise distances, and added-sequence maps. The guide tree guides alignment; it is not a phylogenetic inference. A merge operation can also return its native guide tree, and ambiguity filtering can return excluded sequences. All files retain native contents. Some settings are incompatible; a native failure is reported instead of silently replacing your choices.
The hosted runtime uses MAFFT 7.526, two threads, and a nine-minute native execution limit. Auto remains the initial method, while Native default runs MAFFT without a preset. Upload limits, plan limits, and residue-based credit pricing are unchanged. External RNA structure methods and search tools are not installed in this runtime.
The output alignment shows homologous positions as columns. Gap characters (-) indicate insertions or deletions relative to other sequences.
The Files tab includes the alignment and MAFFT's native diagnostic log. The log records the strategy that Auto actually selected, the runtime version, thread count, and any warnings produced during alignment.
Alignment length is the total number of columns, which exceeds any individual sequence length due to gaps. A good alignment minimizes scattered gaps and maximizes contiguous aligned blocks.
Conserved columns (identical residues across all sequences) suggest functional importance. Semi-conserved positions (similar amino acids) often indicate structural constraints.
Both tools produce high-quality alignments, but they excel in different scenarios:
MAFFT's iterative methods (L-INS-i, E-INS-i) generally achieve higher accuracy for difficult alignments with divergent sequences. The FFT-based approach is particularly effective when sequences have variable-length insertions.
Clustal Omega scales better to very large datasets (>10,000 sequences) thanks to its mBed algorithm. Its HMM-based profile alignment can be more robust for sequences with low complexity regions.
For most users with datasets under 1,000 sequences, either tool produces excellent results. We recommend trying both on a subset and comparing the alignments visually.
Multiple sequence alignment is typically the first step in analysis pipelines:
MAFFT assumes input sequences are homologous. It will produce an alignment for any input, but unrelated sequences yield meaningless results. Verify evolutionary relationships before aligning.
The iterative methods (L-INS-i, G-INS-i, E-INS-i) become slow for datasets exceeding a few hundred sequences. Switch to FFT-NS-2 or PartTree for larger datasets.
Very divergent sequences (below ~20% identity for proteins) may not align reliably with any sequence-based method. Consider structure-based alignment with USAlign for such cases.
Align multiple protein or nucleotide sequences with high-accuracy PPP refinement.
Hardware-accelerated edit distances and global or local sequence scores
Search and cluster protein or nucleotide sequences for homology discovery at large scale.
Universal structure alignment for proteins, RNA, and DNA molecules
Align multiple protein or nucleotide sequences and export FASTA, Clustal, or Phylip outputs.
Build phylogenetic trees from aligned protein or nucleotide sequences using approximate maximum-likelihood methods.
Build maximum likelihood phylogenetic trees with automatic model selection and ultrafast bootstrap.
Align and compare whole genomes to detect SNPs, indels, and structural variants.
Analyze antibody and T cell receptor variable domain sequences
Find protein sequence matches in Swiss-Prot and PDB.