All protocols

Get sequence statistics for FASTA/FASTQ with seqkit

Use seqkit stats to print read and contig counts, length distribution, N50, GC, and quality metrics for any FASTA or FASTQ file.

SDSomenath DuttaUpdated July 21, 2026

Prerequisites

  • seqkit installed (`conda install -c bioconda seqkit`)
  • A FASTA or FASTQ file (optionally gzipped)

1Print basic stats for a FASTQ

Point seqkit stats at your file to get the read count, total bases, and length range. It reads gzipped input directly, so there is no need to decompress first.

bash
seqkit stats reads.fastq.gz

Expected output

file            format  type  num_seqs      sum_len  min_len  avg_len  max_len
reads.fastq.gz  FASTQ   DNA  1,000,000  151,000,000      151    151.0      151

2Get N50, GC, and quality with -a

Add the -a (all statistics) flag to compute N50, GC content, and Q20/Q30 percentages. This is what you want when assessing an assembly or a reference genome; quality columns read 0 for FASTA since it carries no base qualities.

bash
seqkit stats -a genome.fasta

Expected output

file          format  type  num_seqs      sum_len  min_len    avg_len    max_len     Q1      Q2       Q3  sum_gap        N50  Q20(%)  Q30(%)  GC(%)
genome.fasta  FASTA   DNA        215  128,451,203      512  597,447.5  9,215,872  8,412  45,120  215,304        0  4,215,304    0.00    0.00  41.20

Troubleshooting

seqkit: command not found

Install it from Bioconda: `conda install -c bioconda seqkit`.

You only see basic columns and need N50 or GC

Add the `-a` (all statistics) flag. To summarize many files in one table, run `seqkit stats -a *.fasta`.