Written and maintained by CASRAI Editorial Board
Last updated
Trimmomatic is a Java command-line tool that trims adapters and low-quality bases from Illumina FASTQ reads, in single-end or paired-end mode, before alignment or assembly. You choose the trimming steps and their order on the command line, and in paired-end mode it writes four output files so that read pairs stay in sync.
This page is for bench and bioinformatics staff who need to read, write or audit a Trimmomatic command. It explains what each step does and what the output files mean. It does not recommend thresholds, because the right values depend on the library and the downstream tool.
Definition and scope
Trimmomatic is a flexible read-trimming tool for Illumina NGS data, described by Bolger, Lohse and Usadel in Bioinformatics 30(15):2114-2120 (2014). It handles reads in FASTQ format, with Phred+33 or Phred+64 quality encoding (auto-detected unless you set -phred33 or -phred64). It is hosted by de.NBI/ELIXIR, and the software is released under the GPL; the Illumina adapter sequences shipped with it are owned by Illumina and used with permission, so they are not covered by the GPL.
It sits between quality assessment and alignment: FastQC shows where quality drops or adapters appear, and a trimmer such as Trimmomatic or fastp acts on what the report shows. Quality values in the input are Phred quality scores.
How Trimmomatic is used in practice
The command names the mode (SE or PE), optional settings, the input and output files, and then the trimming steps. According to the project README, the general forms are:
- Single-end:
java -jar trimmomatic.jar SE [options] <input> <output> <steps...> - Paired-end:
java -jar trimmomatic.jar PE [options] <in1> <in2> <paired-out1> <unpaired-out1> <paired-out2> <unpaired-out2> <steps...>
The README lists these options: -threads (default 0, meaning automatic), -phred33 / -phred64, -trimlog, -summary, -basein / -baseout, -validatePairs and -compressLevel. Compression of input and output is inferred from the file suffix (.gz, .bz2 or .zip).
Steps run in the order you write them. The README states that steps are executed in command-line order, so putting MINLEN before a clipping step is a different command from putting it after. This is the most common thing to check when auditing someone else’s command.
Why paired-end mode writes four files
Paired-end mode takes two input files and produces a paired and an unpaired output for each. Trimming can remove one read of a pair entirely while the other survives; the survivor goes to the unpaired file for its side, and the paired files keep only reads whose mate also survived, so the two paired files stay in matching order. The 2014 paper describes this as tracking pairing information and storing paired and unpaired reads separately.
Simplified invocation (v0.41 and later)
The README describes a simplified invocation for version 0.41 and later: give only the input files, and output names are generated automatically. When no steps are given, the defaults are TruSeq3 adapter clipping with polyG handling, followed by SLIDINGWINDOW:4:20 and MINLEN:36.
The trimming steps
The README lists these steps: ILLUMINACLIP, LEADING, TRAILING, HEADCROP, TAILCROP, CROP, SLIDINGWINDOW, MAXINFO, MINLEN, MAXLEN, AVGQUAL, BASECOUNT, TOPHRED33 and TOPHRED64. The syntax for the ones with documented parameters is below.
| Step | Syntax (README) | What it does (source) |
|---|---|---|
| ILLUMINACLIP | ILLUMINACLIP:<fasta>:<seedMismatches>:<palindromeClipThreshold>:<simpleClipThreshold>[:<minAdapterLength>[:<keepBothReads>]] |
Removes adapter sequences from the supplied FASTA file using the simple and palindrome modes described below. Minimum adapter length for palindrome mode defaults to 8. |
| SLIDINGWINDOW | SLIDINGWINDOW:<windowSize>:<requiredQuality> |
Scans from the 5′ end and cuts the read when the average quality in the window falls below the threshold (2014 paper). |
| MAXINFO | MAXINFO:<targetLength>:<strictness> |
Balances target read length against error rate; strictness runs from 0.0 to 1.0 (README; paper). |
| LEADING / TRAILING | LEADING:<quality>, TRAILING:<quality> |
Take a quality value as their parameter (README syntax). |
| MINLEN | MINLEN:<length> |
Takes a length as its parameter; in the v0.41 defaults it is applied last (README). |
ILLUMINACLIP: why two thresholds
The paper describes two adapter-detection modes, and the ILLUMINACLIP fields map onto them:
- Simple mode (controlled by the simple clip threshold) scans reads from the 5′ end for adapter matches. The seed need not match perfectly, a user-defined number of mismatches is tolerated, and if the local alignment score exceeds the threshold, the aligned region and everything after it are removed.
- Palindrome mode (controlled by the palindrome clip threshold) detects read-through, where the fragment is shorter than the read length. It is for paired-end data only, and the paper reports it as more sensitive and specific than simple mode for that case, but it detects only that case. The authors therefore combine both modes.
Where it matters for labs and sequencing cores
- Reproducibility. Because step order changes the result, record the full command, the jar version and the adapter FASTA file used. The
-trimlogand-summaryoptions exist to keep a record of what was trimmed. - Cluster jobs. The README warns that on SGE, SLURM, LSF or PBS nodes without cgroup CPU limits, the simplified invocation may request all CPUs on the node and exhaust virtual memory. It recommends setting
MALLOC_ARENA_MAX=2with-XX:ActiveProcessorCounttaken from the scheduler’s slot count, or using explicitPE/SEwith-threads. - Citation. The README asks users to cite Bolger, Lohse and Usadel (2014) for all versions, and Beier et al. (Bioinformatics, 2026) for version 0.40 and later.
- Related format work. If your reads start as alignments, see converting BAM to FASTQ; for scripted pipelines, see Python for bioinformatics.
Common misunderstandings
- “The unpaired files are junk.” They hold reads whose mate was discarded. Whether to use them downstream is a pipeline decision; the paired files are the ones that stay in sync.
- “Palindrome mode replaces simple mode.” It does not; it detects only read-through, so the paper combines both.
- “Step order does not matter.” Steps run in command order.
- “The GPL covers everything in the download.” The adapter sequences belong to Illumina and are used with permission.
- “The paper defines every command.” Step names such as LEADING and MINLEN are documented in the README, not the 2014 paper.
FAQ
What is Trimmomatic used for?
Removing Illumina adapter sequences and low-quality bases from FASTQ reads, in single-end or paired-end mode, before alignment or assembly.
Does Trimmomatic need Java?
Yes. It is run as java -jar trimmomatic.jar. The README says building from source needs JDK 25 or later and Maven.
How do I handle paired-end reads?
Use PE mode with two inputs and four outputs (paired and unpaired for each read), as in the syntax above.
Trimmomatic or fastp?
Both trim reads; see the fastp guide for that tool. This page does not rank them.
Sources
- Trimmomatic README, github.com/usadellab/Trimmomatic (read 2026-11-08).
- Bolger AM, Lohse M, Usadel B. Trimmomatic: a flexible trimmer for Illumina sequence data. Bioinformatics 2014;30(15):2114-2120. doi:10.1093/bioinformatics/btu170. PMC4103590 (read 2026-11-08).







