Filter DNA
v1.0.0Clean DNA sequences by removing or replacing non-standard nucleotides with IUPAC-aware filters.
Paste a DNA sequence or FASTA records, choose which characters to keep, and Filter DNA returns a clean FASTA file. Spaces, line breaks, position numbers, and invisible characters from Word or PDF copies are always removed. Letters outside the kept set are deleted or replaced, and every change that could alter the sequence is reported above the result.
A sequence copied from an NCBI nucleotide page, with the ORIGIN line, position numbers, 10-base blocks, and the // terminator, filtered with the default settings and a line length of 60:
ORIGIN
1 gatcctccat atacaacggt atctccacct caggtttaga tctcaacaac ggaaccattg
61 ccgacatgag acagttaggn nnnnnnnnnn atcttcgaca tgatcaacga
//>Sequence
GATCCTCCATATACAACGGTATCTCCACCTCAGGTTTAGATCTCAACAACGGAACCATTG
CCGACATGAGACAGTTAGGNNNNNNNNNNNATCTTCGACATGATCAACGAThe summary line reads 1 sequence · 110 bases · 14 characters removed. The run of n is an assembly gap, so the default Standard 4 + N mode keeps it.
With Filter mode set to Standard 4 bases, only A, C, G, and T survive. Headers stay exactly as written, including their descriptions:
>contig_7 partial
ACGTTGCA NNNNN GGCTAGRTTA
>contig_8
TTGACCWAGG CATG>contig_7 partial
ACGTTGCAGGCTAGTTA
>contig_8
TTGACCAGGCATGDeleting letters shifts every base after them, so the page warns:
Deleted 7 characters outside the kept set: N (5), R (1), W (1). Bases after each deletion shift position; to keep the sequence length, replace them with N instead.Set Replace invalid with to N and the same input keeps its length. Each R, W, and N becomes N, while the spaces are still deleted:
>contig_7 partial
ACGTTGCANNNNNGGCTAGNTTA
>contig_8
TTGACCNAGGCATGThe summary reports 2 sequences · 37 bases · 3 characters removed · 7 replaced with N.
Paste text or upload a file. FASTA records keep their headers; text without a > header is treated as one sequence named Sequence.
| Input | Accepted |
|---|---|
| Files | .txt, .fasta, .fa, .fas, .fna, .fsa, .seq, .docx, .pdf (up to 10 MB) |
| Word and PDF | Text is extracted from .docx and .pdf uploads; soft hyphens, zero-width spaces, and non-breaking spaces are removed |
| NCBI pages | The ORIGIN block with position numbers; annotation above ORIGIN is ignored with a warning |
| Plain text with a name | A first line that is clearly not DNA (such as BRCA1 exon 2) becomes the sequence name, with a warning |
| Compact FASTA | >name ACGTACGTAC on one line, when no sequence lines follow |
| Comment lines | Lines starting with # or ; are skipped, with a warning |
FASTQ, full GenBank records (starting with LOCUS), and EMBL or UniProt flat files (starting with ID) are rejected with a message naming the tool that extracts their sequences first: FASTQ to FASTA, GenBank to FASTA, or FASTA Converter.
| Setting | What it does | Default |
|---|---|---|
Filter mode | Which characters to keep. See the table below. | Standard 4 + N (unknown) |
Custom allowed characters | Characters to keep, case-insensitive. Spaces and commas between them are ignored, so A, C, G, T equals ACGT. Shown only for Custom allowed characters. | ACGT |
Replace invalid with | What goes in place of each character outside the kept set: Delete, N, n, -, ., ?, X, x, or Custom character. Hidden for the three Remove ... modes, which only delete. | Delete |
Custom replacement | One character to insert. Shown only for Custom character. | empty |
Output case | Uppercase, Lowercase, or Preserve original for the kept bases. Replacement characters are inserted as chosen, so n stays lowercase in uppercase output. | Uppercase |
Preserve FASTA headers | Keep each record's > header line. Turn it off to write bare sequences to a .txt file. | On |
Line length | Bases per line in the output, from 0 to 1000. 0 puts each sequence on one line. | 80 |
Whitespace, digits, and invisible characters are formatting, not sequence. They are always deleted and never replaced, so replacing with N masks real ambiguity codes without turning every space or position number into an N.
| Mode | Keeps | Typical use |
|---|---|---|
Standard 4 bases (A, C, G, T) | A, C, G, T | Tools that reject any ambiguity |
Standard 4 + N (unknown) | A, C, G, T, N | Cleaning pasted sequences while keeping gaps and unknown bases |
IUPAC nucleotide codes | A, C, G, T, R, Y, S, W, K, M, B, D, H, V, N | Keeping degenerate positions from primers or consensus sequences |
IUPAC + gap characters (-, .) | IUPAC codes plus - and . | Cleaning aligned sequences without losing gaps |
All letters (A-Z) | Any letter | Removing only punctuation and symbols |
All letters + gap (A-Z, -, .) | Any letter plus - and . | Light cleanup of alignments |
Remove whitespace only | Everything except whitespace | Joining a wrapped sequence |
Remove digits only | Everything except 0 to 9 | Stripping position numbers but keeping spaces |
Remove digits and whitespace | Everything except digits and whitespace | Removing formatting without judging letters |
Custom allowed characters | Your own list | Any other alphabet |
The IUPAC ambiguity codes stand for sets of bases: R (A or G), Y (C or T), S (G or C), W (A or T), K (G or T), M (A or C), B (not A), D (not C), H (not T), V (not G), and N (any base).
The result opens on Preview, which shows the filtered sequences and a one-line summary with the sequence count, output length, characters removed, and characters replaced.
| File | Contents |
|---|---|
<name>_filtered.fasta | Filtered records. Named after the uploaded file or the header of a single record, otherwise filtered.fasta. With headers turned off, the extension is .txt. |
run.log | Settings used, counts of removed whitespace, digits, and invisible characters, a count for each character outside the kept set, input and output length per record, and every warning. |
Warnings appear above the preview only when the output could differ from what you expect:
If every character is outside the kept set, the run stops with an error instead of producing empty records.
| Starting point | Tool |
|---|---|
| A sequence with numbers, spaces, or stray symbols | Filter DNA |
| Loose text, a table, or a document with several sequences and names | TXT to FASTA |
| A GenBank record | GenBank to FASTA |
| Sequencing reads in FASTQ | FASTQ to FASTA |
| An RNA sequence with U | RNA to DNA |
| A protein sequence | Filter Protein |
Paste it with the default settings. Position numbers, spaces, tabs, and line breaks are always removed, and the output is rewrapped at the chosen line length.
Choose Standard 4 bases as the filter mode and N as the replacement. Every R, Y, S, W, K, M, B, D, H, and V becomes N, and the sequence length stays the same.
Yes. The default Standard 4 + N mode keeps N because it usually marks an assembly gap or an unread base, and deleting it would shift every downstream position.
Choose IUPAC nucleotide codes or Standard 4 + N, which do not keep - or ., and leave the replacement on Delete. To keep the gaps instead, use IUPAC + gap characters.
No. Header lines are kept exactly as written, including descriptions after the identifier. Turn off Preserve FASTA headers to output bare sequences.
No. Filtering runs in your browser, so the sequence never leaves your computer.
Repair SDF, MOL, and MOL2 ligands for RDKit, Meeko, and docking preparation workflows.
Split FASTA records by count, target file count, record length, or one sequence per file.
Prepare biomolecular structures for electrostatics calculations with charge and radius assignment.
Clean protein sequences by removing or replacing non-standard amino acids with configurable filters.
Shuffle DNA sequences while preserving nucleotide, dinucleotide, or k-mer composition.
Extract CDS, mRNA, gene, rRNA, and tRNA features from GenBank records into FASTA.
Generate reverse, complement, or reverse-complement sequences from raw, FASTA, or FASTQ DNA and RNA input.
Fix PDB and mmCIF structures by adding missing atoms, residues, hydrogens, and solvent.
Optimize coding DNA for a target organism with DNA Chisel while preserving its translation.
Convert CSV or TSV sequence tables to FASTA with automatic delimiter detection and column mapping.