Random DNA Sequence Generator
Enter a length from 1 to 1,000,000 and get a random string of A, T, C and G bases, useful as test input for sequence tools and class exercises.The Random DNA Sequence Generator produces a string of the four DNA bases, A, T, C and G, at whatever length you ask for, from a single base up to one million. Enter the length, press the button, and the sequence appears in a card below the form. The default is 300 bases, which is about the length of a typical exon. It's a plain random-data tool: nothing about the output is taken from a real genome, which is exactly what you want when you need test input that can't be mistaken for real data.
How the sequence is made
Each position is filled independently by picking one of the four nucleotides with equal probability, using the browser's Math.random. So a 300-base sequence will have roughly 75 of each base, GC content near 50 percent, and no structure at all: no start codons placed on purpose, no reading frame, no repeats beyond what chance produces. There is no seed option, so you can't reproduce a sequence later; copy it from the card if you need to keep it. Very long requests (hundreds of thousands of bases) are generated in the page and rendered as one block of text, so expect the browser to take a moment and the card to be tall.
What it's useful for
- Testing sequence-handling code. Feed a 10,000-base string into a k-mer counter, a reverse-complement function or a FASTA parser to check it handles length and edge cases before you point it at real reads.
- Teaching examples. Generate a 30-base sequence and have students transcribe it to mRNA, find the ORFs, or translate it with a codon table. Random sequences are good for this because there's no answer to look up.
- Null models. If you're asking whether a motif appears in a gene more often than chance, a batch of random sequences of the same length gives you a rough background rate. Note that uniform random is a crude null; real genomes have skewed base composition.
- Placeholder data. Mock-ups of lab software, sample files for a tutorial, or fake "gene" strings for a game or story where nobody will BLAST them.
Reading the output
The four letters stand for adenine, thymine, cytosine and guanine. A pairs with T and C pairs with G, so the complementary strand of any sequence you generate can be written by swapping those letters and reversing the string. Three consecutive bases form a codon; 61 of the 64 possible codons specify an amino acid and three (TAA, TAG, TGA) are stop signals. In a uniform random sequence a stop codon appears about once every 21 codons in any given frame, which is why random DNA almost never contains a long open reading frame; if you want a fake gene that translates cleanly, you'll need to edit the stops out by hand. Because there is no line wrapping in the card, paste long sequences into a text editor if you need FASTA formatting (a header line starting with a greater-than sign, then the sequence in 60- or 80-character lines).
Related generators
For random text that isn't limited to four letters, the Random String Generator lets you choose the alphabet and length. If you need identifiers rather than sequences, try the Random Code Generator or the Random API Key Generator, and for cryptographic use the Encryption Key Generator. All of these are under all developer & test data tools.
Frequently asked questions
- Are the generated sequences real genes?
No. Every base is chosen at random with equal probability, so the output doesn't correspond to any organism, gene or known sequence. Treat it as test data only.
- What is the maximum length?
1,000,000 bases. The minimum is 1. Long sequences take a little time to render because the whole string is displayed on the page.
- Can I set the GC content or use RNA bases?
Not at the moment. The tool always uses A, T, C and G with equal weight. For RNA, replace every T with U after generating.
- Can I get the same sequence again?
No. There is no seed option, so each press is independent. Copy the sequence from the card if you need to reuse it.



