Understanding the RPKM, FPKM and TPM calculator — concept and principle
RNA-seq read counts depend on both gene length and sequencing depth: a long gene collects more reads than a short one at the same expression level, and a deeper library gives every gene more reads. RPKM (or FPKM for paired-end fragments) and TPM correct for both. This calculator converts a gene's raw read count into RPKM/FPKM and TPM so you can compare expression within and between samples.
How it is calculated
- RPKM/FPKM = reads ÷ (gene length in kb × total mapped reads in millions).
- RPK = reads ÷ gene length in kb (reads per kilobase).
- TPM = RPK ÷ ΣRPK × 10⁶, where ΣRPK is the sum of RPK over all genes in the sample (entered in millions).
FPKM uses fragments (read pairs) instead of reads; the arithmetic is the same.
The principle
Both measures divide by length and by depth, but in a different order. RPKM first scales by library size, then by length. TPM first divides every gene by its length, then scales so that all genes in the sample add up to one million. Because TPM values always sum to 10⁶, a TPM is a proportion: it says how many transcripts of this gene you would find in a pool of one million transcripts. RPKM totals differ from sample to sample, which makes cross-sample proportions harder to interpret.
Worked example
- Inputs: 500 reads, gene length 2 kb, 20 million mapped reads, ΣRPK = 8 million.
- RPKM = 500 ÷ (2 × 20) = 12.5.
- RPK = 500 ÷ 2 = 250.
- TPM = 250 ÷ 8,000,000 × 1,000,000 = 31.25.
| Gene length (kb) | RPKM / FPKM |
|---|---|
| 0.5 | 50 |
| 1 | 25 |
| 1.5 | 16.66666667 |
| 2 | 12.5 |
| 2.5 | 10 |
| 3 | 8.333333333 |
| 4 | 6.25 |
How to read the result
A TPM of 31.25 means this gene accounts for about 31 of every million transcripts in the sample, or about 0.003%. Very roughly, values below about 1 are often treated as low or not expressed, but the cut-off depends on the tissue, depth and pipeline. For differential expression between conditions, statistical tools work on raw counts with their own normalisation (for example DESeq2 or edgeR) rather than on RPKM or TPM.
Common mistakes
- Entering gene length in bases instead of kilobases.
- Using total reads instead of mapped reads, or a ΣRPK from a different sample.
- Comparing TPM across samples with very different composition, where a few highly expressed genes shift all other values.
Frequently asked questions
Should I use TPM or FPKM?
For within-sample proportions and most reporting, TPM is preferred because it sums to a constant.
Can I convert FPKM to TPM?
Yes: TPMᵢ = FPKMᵢ ÷ ΣFPKM × 10⁶ within the same sample.
What is CPM?
Counts per million: reads ÷ total mapped reads × 10⁶, with no length correction.
Sources: A. Mortazavi et al., "Mapping and quantifying mammalian transcriptomes by RNA-Seq", Nature Methods 5, 621–628 (2008) · G. P. Wagner, K. Kin and V. J. Lynch, "Measurement of mRNA abundance using RNA-seq data", Theory in Biosciences 131, 281–285 (2012)