Shuffle DNA
Randomly shuffle DNA sequences while preserving exact base composition

Raw DNA or one or more FASTA records. Each sequence is shuffled independently. Input limit: 300,000,000 characters.

💡 Quick Summary

Shuffle DNA randomly shuffles the bases of one or more DNA sequences using a Fisher-Yates permutation. Because shuffling is a permutation rather than random sampling, the output sequences have exactly the same base composition as the inputs — only the order of bases changes. Shuffled sequences serve as composition- and length-matched controls for evaluating sequence analysis results.

📋 How to Use
  1. Paste one or more raw or FASTA sequences into the textarea. Multiple FASTA records are each shuffled independently. Input limit: 300,000,000 characters.
  2. Click Run. Each sequence is independently shuffled and output as a FASTA record. Use Copy to copy the plain-text result.
🧮 Formulas & Logic
Fisher-Yates shuffle
For an array of N bases, iterate from index N−1 down to 1; at each step i, pick a random index j in [0, i] and swap positions i and j. Every permutation of the sequence is equally likely.
📊 Result Interpretation
Exact composition preserved

Unlike sampling-based tools, shuffling does not change the count of any base. If the input is 60% A+T, the shuffled output is also exactly 60% A+T.

Order randomised

All positional information (motif positions, repeats, biases) is destroyed. The shuffled sequence has no sequence-level similarity to the original.

Multi-FASTA support

If you paste multiple FASTA records, each sequence is shuffled independently. The number of output records equals the number of valid input records.

🔬 Applications
  • Generating composition- and length-matched null sequences for statistical testing of motif enrichment
  • Producing background sequences that share exactly the same base composition as a query sequence
  • Testing analysis pipelines with sequences that have identical composition but no sequence similarity to real data
  • Evaluating whether an analysis result depends on sequence order rather than just composition
⚠️ Common Mistakes & Warnings
Non-DNA characters are stripped before shuffling

Digits, spaces, and non-IUPAC characters are removed from each sequence before shuffling. The output length may be shorter than the input if invalid characters were present.

Shuffling is not the same as sampling

Shuffle DNA produces a single permutation of the input. To generate many independent randomised sequences from a template, use Sample DNA instead.

❓ Frequently Asked Questions

How does Shuffle DNA differ from Sample DNA?
Shuffle DNA is a permutation — every base in the input appears exactly once in the output, so composition is preserved exactly. Sample DNA draws bases with replacement from a guide, so the output composition is only approximately equal to the guide and the output length is independent of the guide length.
Can I shuffle multiple sequences at once?
Yes — paste multiple FASTA records into the input textarea. Each record is shuffled independently and output as a separate FASTA entry.
Does the tool handle IUPAC ambiguity codes (N, R, Y, etc.)?
Yes — IUPAC codes are treated as regular characters and included in the shuffle pool. They appear in the output in proportion to how often they occurred in the input.