Home / Science / Molecular and cell biology / Genomics and bioinformatics / k-mer counter and spectrumTool #176

k-mer counter: k-mer spectrum, most common k-mers and a rough genome size from FASTA or FASTQ, in your browser

Count every k-letter word in FASTA or FASTQ files (gzip too, any size), with reverse complements together. See the k-mer spectrum, the most common k-mers, a look-up box and a rough genome size from the spectrum's peak. Download the spectrum as CSV. Nothing is uploaded.

Keep it one tap away for everyday use.

Bookmark k-mer counter and spectrum?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Open reads
  2. Pick k
  3. Spectrum
  4. CSV
Nothing is uploadedWorks offline once open

Sequences

FASTA, FASTQ or plain sequence, any size, also .gz; files are read piece by piece on your device and nothing is uploaded. The example is 10,000 reads of 100 bases simulated from a made-up 40,000-base genome with a repeat and 1 % errors.

Use canonical counting for reads, which come from both strands. 21 is a common k for genomes; small k (3 to 8) shows word use in short sequences.

What it does

A k-mer is a word of k letters taken from a sequence: the read ACGTAC holds the 3-mers ACG, CGT, GTA and TAC. Counting every k-mer in a set of reads is a quick, assembly-free way to see what is in them:

  • The spectrum plots how many distinct k-mers were seen once, twice, three times and so on. For good whole-genome reads it has a tall wall at 1 (k-mers carrying a sequencing error), a valley, then a hump at the typical depth of the genome, with a tail of repeats to the right.
  • Most common k-mers shows the top 20 with their share, which is where adapters, primers and repeats stand out.
  • Look up a k-mer gives the count of any word you type.
  • Genome size (rough) is the number of k-mers counted from the valley on, divided by the depth at the peak. It assumes one copy of each chromosome set and even coverage, so treat it as a first guess, not a measurement.

Options

  • k is the word length, from 1 to 25. Longer words are more likely to be unique in a genome; 21 is a common choice. Small k (3 to 8) is useful for word use and composition in short sequences.
  • Count a word and its reverse complement together merges ACG with CGT. Leave it on for reads, which come from both strands; turn it off for strand-specific data.

Letters other than A, C, G and T (such as N) break the sequence, and no word is counted across them. Up to 5 million distinct k-mers are kept; the page says so if a file has more.

Worked example

The example is 10,000 reads of 100 bases simulated from a made-up 40,000-base genome that holds a 600-base repeat three times, with 1 % random errors. With k = 21 and reverse complements together, the 1,000,000 bases give 800,000 k-mers, 188,111 of them distinct. 145,234 are seen only once: nearly all of them hold an error. The valley is at 4×, the main peak at 15× (25× read coverage, less the k-mers lost to read ends and errors), and the genome size estimate is about 43,100 bases, within 8 % of the true 40,000. The repeat’s k-mers form a small second hump around 45 to 50×, about three times the peak. Turn off reverse complements and the peak halves, because each strand is now counted on its own.

FAQ

Is my data uploaded? No. Files are read piece by piece in your browser, so even large or private sequencing data stays on your device. There are no ads on this page.

Why is my genome size estimate off? Heterozygous genomes have a second, half-height peak, polyploid ones more, and low coverage (under about 15×) blurs the peak. Dedicated tools fit a model to the whole spectrum for that; this page gives the simple peak estimate.

Can I use an assembly? Yes, for counting and the most common k-mers, but an assembly has no error wall or depth hump, so no genome size is given.

Where the numbers come from

  • k-mer counting, spectrum and the peak-based genome size written by fibub. Counts, spectrum and most common k-mers checked in the tests and against a separate Python Counter script for k = 5, 21 and 25, with and without reverse complements.
  • The example reads are simulated: a seeded random 40,000-base genome with a made-up repeat, 1 % random errors.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Change log for k-mer counter and spectrum

  1. Add k-mer counter and spectrum (#176) Details on GitHub

Every change to fibub

Related tools

FASTQ and FASTA quality inspector #171 Open a FASTQ or FASTA file of any size (.gz too) and see read counts, lengths and N50, GC content per read, quality by position as boxes, reads by mean quality, base composition along the read and the most repeated sequences. The file is read on your device and never uploaded. Phylogenetic tree viewer #177 Open a Newick or NEXUS tree file and draw it as a rectangular or circular tree, with branch lengths and support values. Reroot it at the midpoint or on any branch, ladderize, swap branches and colour groups. Download SVG, Newick, tip distances (CSV) or a report. Nothing is uploaded. Pairwise sequence alignment #172 Align two DNA or protein sequences end to end (global), with free end gaps (semi-global) or by their best-matching stretch (local), with affine gap scores you can set. See the score, identity, similarity and gaps, the alignment in blocks, and a dot plot. Runs in your browser. BED, GFF and GTF interval tools #175 Open a BED, GFF3 or GTF file (gzip too) and see intervals per chromosome and feature type, bases covered and lengths. Merge overlapping intervals, find where two files overlap, keep or drop overlaps, or cut one file out of another, with bedtools rules. Download the result as BED. Nothing is uploaded. DNA sequence tools #163 Paste a DNA or RNA sequence or open a FASTA file. Get the length and GC content, the reverse complement, the protein in any of the six reading frames, every open reading frame above a length you choose drawn on a map, and a codon usage table. Runs in your browser; your sequence never leaves the device. Tree builder #308 Paste aligned DNA sequences (FASTA) and build a tree by neighbour joining or UPGMA on p, Jukes-Cantor or Kimura 2-parameter distances, or by maximum parsimony with an exact branch and bound search. See the distances, root the tree and download it as Newick. Runs in your browser. Stylometry: Burrows' Delta #413 Paste or open several texts, compare them on their most frequent words with Burrows' Delta, see a clustered heat map of the distances, and find the closest candidate author for a disputed text. Nothing is uploaded. Topic modelling (LDA) #414 Find the topics in a small collection of letters, notes or articles with latent Dirichlet allocation (collapsed Gibbs sampling): top words per topic, the topic mix of every document, and CSV downloads. Seeded, so runs repeat exactly. Nothing is uploaded. Corpus concordancer #733 Paste text or open your own .txt files to see every use of a word in context (KWIC), sorted by the words around it, plus a word frequency list, repeated n-grams and collocates ranked by MI, t-score or log-likelihood G². Nothing is uploaded. Lexical diversity and readability #736 Paste a text to get type-token ratio, root TTR, MATTR, MTLD, HD-D and Yule's K, plus Flesch reading ease, Flesch-Kincaid grade, Gunning fog, SMOG, Coleman-Liau and ARI, with a moving-window chart. Free, in your browser.