Written and maintained by CASRAI Editorial Board
Last updated
Who this is for: researchers with raw sequencing reads (FASTQ) who need to trim adapters, filter low-quality reads and get a before/after quality report in one command. After reading you should be able to run fastp on single-end and paired-end data, know which filters are on by default, and read its HTML and JSON reports.
fastp is an open-source FASTQ preprocessor that performs quality control, adapter trimming, quality filtering and per-read quality pruning in a single pass and writes an HTML and a JSON report with statistics before and after filtering. It was published by Chen, Zhou, Chen and Gu in Bioinformatics in 2018, and its source and manual live in the OpenGene/fastp repository on GitHub.
What fastp is used for in research
fastp sits between the sequencer’s raw FASTQ output and downstream steps such as alignment, assembly or metagenomic profiling. According to the 2018 paper, one run covers:
- quality control with reports before and after filtering;
- adapter trimming, including detection of adapters from the non-overlapping bases of paired reads;
- quality filtering and per-read quality pruning;
- UMI handling, polyG/polyX tail trimming, and splitting of output files.
The qualities fastp filters on are Phred quality scores. If you are working from aligned data instead of raw reads, see converting BAM to FASTQ first.
Install or access
The official installation routes are listed in the OpenGene/fastp README (read 2026-11-07):
- Bioconda:
conda install -c bioconda fastp. The README notes the Bioconda build may lag the latest release. - Prebuilt Linux binary:
wget http://opengene.org/fastp/fastpfollowed bychmod a+x ./fastp. - From source: requires the isa-l, libdeflate and libhwy (version 1.1.0 or later) libraries, then
make -jandsudo make install.
Check the installed build with the command-line help, since options can differ between releases. The README references release numbers of the form fastp.1.4.0.
Step-by-step: trimming and filtering reads
Single-end reads
- Run
fastp -i in.fq -o out.fq.-iis the input FASTQ and-othe output. - fastp writes
fastp.htmlandfastp.jsonto the working directory by default. Rename them with-h(HTML) and-j(JSON), and set the report heading with-R/--report_title.
Paired-end reads
- Supply both mates:
fastp -i in.R1.fq.gz -I in.R2.fq.gz -o out.R1.fq.gz -O out.R2.fq.gz. Gzip-compressed input and output are shown in the README example. - Add
--detect_adapter_for_pe(short form-2) if you want fastp to auto-detect adapters for paired-end data. See the gotcha below.
What is on by default
This table is taken from the README’s option descriptions (read 2026-11-07).
| Step | Default | Key options and defaults | Switch off |
|---|---|---|---|
| Adapter trimming | On | -a read 1 adapter (auto-detected for single-end if omitted); --adapter_sequence_r2; --adapter_fasta |
-A |
| Quality filtering | On | -q 15 (a base is qualified if Phred is at least 15); -u 40 (percent of unqualified bases allowed); -n 5 (N bases allowed); -e 0 (average quality, 0 means off) |
-Q |
| Length filtering | On | -l 15 (minimum length); --length_limit 0 (0 means no maximum) |
-L |
| Low-complexity filter | Off | -y enables it; -Y 30 is the complexity threshold |
not enabled unless -y |
| Paired-end adapter auto-detection | Off | -2 / --detect_adapter_for_pe enables it |
default |
| Gap-overlap trimming | Off | --allow_gap_overlap_trimming |
default |
Paired-end gotcha: for single-end data fastp auto-detects the adapter when you do not give one, but for paired-end data that auto-detection is off unless you pass -2. Without -2 and without explicit adapter sequences, a paired-end run does not use the auto-detected adapters.
The 2018 paper adds two behaviours of the paired-end overlap analysis: fastp can detect adapters from the non-overlapping bases and trim them even when only one base is in the tail, and where the two mates disagree in the overlap it corrects a mismatch when one base is high quality and the other low, with a cap of five mismatches. For NextSeq and NovaSeq data (two-colour chemistry), the paper states polyG trimming is switched on automatically after a flow cell ID check.
Output and how to read it
Both reports show statistics from before and after filtering, so you can confirm that trimming improved the data rather than assume it.
- HTML report (
fastp.html): the human-readable view with quality, length and adapter summaries, and the report title you set with-R. - JSON report (
fastp.json): the same statistics in machine-readable form, with abefore_filteringsection and a post-filtering counterpart. The MultiQC fastp module detects fastp output by the"before_filtering": {string in this file, so keep the JSON when you want to aggregate many samples.
The MultiQC fastp module (Seqera documentation) displays quality, length, adapter and polyG/polyX statistics before and after filtering, side by side for all samples.
FastQC and fastp duplication rates are not the same measurement
In the 2018 paper’s cell-free DNA example, FastQC reported roughly 78 to 80 percent duplication per read, while fastp reported 16.22 percent. The paper attributes the gap to method: fastp evaluates duplication for the read pair as a whole, rather than for each read separately. Compare duplication numbers only between tools that measure it the same way.
Troubleshooting
- Adapters remain in paired-end output. Auto-detection for paired-end data is off by default. Add
-2, or give-aand--adapter_sequence_r2(or--adapter_fasta) explicitly. - Too many reads discarded. Quality and length filters are on by default (
-q 15,-u 40,-n 5,-l 15). Read the before/after counts in the report, then relax a threshold or disable a step with-Qor-Land re-run. - Reports overwritten between samples. The default names are always
fastp.htmlandfastp.json. Set-hand-jper sample. - Bioconda build behaves differently from the manual. The README says the conda package may lag; compare against the version in your installation.
- Source build fails. Confirm isa-l, libdeflate and libhwy 1.1.0 or newer are installed.
Free alternatives
| Tool | Relationship to fastp |
|---|---|
| Trimmomatic | A read trimmer that the 2018 fastp paper benchmarks against |
| Cutadapt | An adapter trimmer that the 2018 fastp paper benchmarks against |
The fastp authors report in their own benchmark that fastp is 2 to 5 times faster than Trimmomatic or Cutadapt. That figure comes from the authors’ own benchmark, so test on your own data before relying on it.
FAQ
How do I cite fastp?
The README lists two citations: Chen S. fastp 1.0, iMeta 2025;4(5):e70078, doi:10.1002/imt2.70078; and the original paper, Chen S, Zhou Y, Chen Y, Gu J. fastp: an ultra-fast all-in-one FASTQ preprocessor. Bioinformatics 34(17):i884-i890, doi:10.1093/bioinformatics/bty560.
Where is the fastp manual and GitHub repository?
The official source, README and option documentation are at github.com/OpenGene/fastp. Run the program with its help flag to see the options in your installed release.
Does fastp trim adapters automatically?
Adapter trimming is on by default. For single-end reads the adapter is auto-detected if you omit -a. For paired-end reads auto-detection needs -2. -A disables adapter trimming.
Which quality threshold does fastp use?
By default a base counts as qualified at Phred 15 or higher (-q 15), and a read is dropped if more than 40 percent of its bases are unqualified (-u 40) or it has more than 5 N bases (-n 5).
Can fastp reports be combined across samples?
Yes. MultiQC includes a fastp module that reads the JSON files.
Sources
- OpenGene/fastp README, github.com/OpenGene/fastp (read 2026-11-07).
- Chen S, Zhou Y, Chen Y, Gu J. fastp: an ultra-fast all-in-one FASTQ preprocessor. Bioinformatics 2018;34(17):i884-i890. PMC6129281 (read 2026-11-07).
- Seqera MultiQC documentation, fastp module, docs.seqera.io/multiqc/modules/fastp (read 2026-11-07).
Related: Bioinformatics Python setup and workflow.







