Alignment format converter

FASTA, Clustal, PHYLIP, NEXUS or Stockholm in. Pick the format you need out.

FASTA

What does an alignment format converter do?

Every alignment program and every phylogenetics program has its own favourite file format, and most read only one or two. A multiple sequence alignment is the same data in all of them: a list of names and equal-length gapped sequences. The converter reads that data from any of the five common formats and writes it back out in the one the next program wants, keeping names, order and gaps exactly as they were.

How to convert an alignment

  1. Paste the alignment. The input format is detected from its first lines; you can override it with the Input selector if a file is unusual.
  2. Choose the output format on the tabs. For PHYLIP, pick sequential or interleaved layout and strict or relaxed names.
  3. Check the count of sequences and the alignment length shown above the result, thenCopy.

What is aligned FASTA?

The simplest format: a >name line followed by the gapped sequence, wrapped at 60 characters. Because every program reads FASTA, it is the safest interchange format and the right choice when you are not sure what comes next. It carries no metadata, so the sequence count and length are only implied.

What is Clustal format?

The .aln output of ClustalW, Clustal Omega and MUSCLE. A header line naming the program, then blocks of 60 columns with the name at the start of each line and a conservation line underneath, where * marks identical columns. Good for reading by eye, less good for downstream tools, which is why it is usually converted.

What is PHYLIP format?

The input of PHYLIP, RAxML, IQ-TREE and PhyML. The first line holds the number of taxa and the alignment length. In the classic strict layout each name occupies exactly 10 characters; the relaxed layout allows longer names separated from the sequence by whitespace. Sequential files give each sequence in full before the next name;interleaved files cycle through the taxa in blocks. Names longer than 10 characters are truncated and made unique when strict is chosen.

What is NEXUS format?

Used by MrBayes, PAUP*, BEAST and Mesquite. A #NEXUS header, then a DATA block with DIMENSIONS, a FORMAT line giving the data type and gap symbol, and a MATRIX of names and sequences ending in a semicolon. The converter sets DATATYPE to DNA, RNA or PROTEIN from the letters in the alignment and quotes names that contain spaces.

What is Stockholm format?

The format of Pfam, Rfam and HMMER. A # STOCKHOLM 1.0 line, optional#=GF, #=GS, #=GC and #=GR annotation lines, one name and sequence per line, and // to end the alignment. Annotation lines are ignored when reading, and only the sequences are written.

Related tools

Combine several alignments with the alignment merger, or remove gappy columns first with the alignment trimmer.

Frequently asked questions

How do I convert FASTA to PHYLIP?

Paste the aligned FASTA above and choose the PHYLIP tab. The converter writes the taxon count and alignment length on the first line, then one name and sequence per taxon. Pick strict names (10 characters) for classic PHYLIP programs, or relaxed names for RAxML, IQ-TREE and PhyML.

Can it convert Clustal to FASTA?

Yes. Paste the .aln output of Clustal Omega, ClustalW or MUSCLE and choose FASTA. The conservation line and the header are dropped and each sequence is joined back into a single record.

Does it handle interleaved PHYLIP, NEXUS and Stockholm files?

Yes. Interleaved and sequential PHYLIP are both recognised, and NEXUS and Stockholm blocks that repeat the same names are joined in order.

What if my sequences are not all the same length?

The converter warns you and pads shorter sequences with gaps so that PHYLIP and NEXUS output stays valid. Check the input, since a ragged alignment usually means a copying error.

What is the difference between strict and relaxed PHYLIP?

Strict PHYLIP gives each name exactly 10 characters, padded with spaces, and the sequence starts in column 11, so longer names are cut. Relaxed PHYLIP allows names of any length without spaces and separates the name from the sequence with whitespace. PHYLIP itself needs strict; RAxML, IQ-TREE and PhyML read relaxed.