
Paste or upload DNA, RNA, or protein text and download FASTA. Conversion stays in your browser; no account is needed. For one wrapped sequence, choose “Join all lines into one sequence”. Learn more
Input
How to convert TXT to FASTA?
Paste raw DNA, RNA, or protein text into the TXT to FASTA converter, or upload a text file, then download the resulting .fasta file. The converter accepts up to 10 million characters, removes copied line numbers and spacing, validates sequence characters, and creates or preserves FASTA headers. Sequence data stays on your device, and no account is required.
Choose how the input lines represent records before converting: Auto-detect sequences treats each non-empty raw sequence line as a separate record. For one sequence wrapped across several lines, select Join all lines into one sequence. For several wrapped sequences separated by blank lines, choose Split on empty lines. Existing FASTA headers preserve record boundaries in every mode. Load the One wrapped DNA sequence or Multiple protein sequences example to try these settings.
Two-column tables are supported too: rows shaped like seq_id<TAB>sequence or seq_id,sequence become FASTA records whose headers come from the first column, so spreadsheet exports convert cleanly. Files copied from Windows tools are handled as well, including UTF-8 byte order marks and non-breaking spaces.
For one sequence, the result contains one FASTA record:
>seq_1
ATGGCCATTGTAATGGGCCGCTGAAAGGGTGCCCGATAGWhile for multi-sequence FASTA files, each sequence gets a new line:
>seq_1
ATGGCCATTGTAATGGGCCGCTGAAAGGGTGCCCGATAG
>seq_2
MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFFor multiple sequences, separate entries with blank lines, existing FASTA headers, or the selected custom separator. The output keeps each sequence as a separate FASTA record so it can be used in alignment tools, sequence search tools, or downstream bioinformatics pipelines.
How to use TXT to FASTA converter
ProteinIQ's TXT to FASTA converter works in your browser and requires no account or payment.
Inputs
Paste the sequence text into the input field or upload a file containing your raw sequences or existing FASTA records.
| Input | Description |
|---|---|
Input | Plain text containing one or more sequences. Accepts up to 10 million characters from pasted text or file uploads. Common extensions: .txt, .fasta, .fa, .fas, .seq, .dat. Maximum file size: 10 MB. |
Settings
Check Multi-sequences first: the default works for separate raw sequences written one per line, while a single wrapped sequence needs Join all lines into one sequence. Then adjust headers, cleanup, or output wrapping if your workflow requires it.
| Setting | Description |
|---|---|
Multi-sequences | Method for identifying separate sequences. Auto-detect sequences (default) treats each non-empty raw sequence line as a separate record while recognizing labels and inline identifiers. Split on empty lines treats each block separated by blank lines as a distinct sequence, which keeps wrapped multi-line sequences together. Join all lines into one sequence converts the whole input as a single wrapped record. Custom separator uses a specified delimiter string. Input that already starts with FASTA headers always keeps one record per > header regardless of this setting. |
Custom separator | Delimiter string for separating sequences when Custom separator mode is selected. Default: ---. The escapes \t, \n, and \r produce tab and line-break delimiters. An empty custom separator is rejected instead of falling back to auto-detection. |
Sequence type | Select Auto-detect (default), DNA, RNA, Nucleotide (DNA or RNA), or Protein. Auto-detect avoids deleting valid protein residues before classification. Explicit DNA mode rejects U, explicit RNA mode rejects T, and Nucleotide accepts both while removing amino-acid-only letters. |
Header format | Controls how sequence identifiers are generated. Preserve existing headers (default) maintains existing FASTA header lines. seq_1, seq_2, ... or sequence_1, sequence_2, ... provide simple incrementing names. Custom prefix allows defining a custom naming scheme. Extract from text (smart) attempts to identify meaningful names from surrounding text. |
Custom prefix | Prefix string for sequence headers when Custom prefix mode is selected. Default: seq. Prefix text is sanitized so spaces, punctuation, or pasted line breaks cannot create malformed FASTA headers. |
Header extraction pattern | Refines smart extraction behavior when using Extract from text (smart) mode. First word of each sequence block takes the initial word before each sequence. Line numbers searches for patterns like "1.", "2.". Sequence identifiers looks for conventions like "seq1" or "protein_a". |
Line wrapping | Number of characters per line in the output. 80 characters per line (standard) (default) follows NCBI recommendations. 60 characters per line is common in many workflows. No wrapping (single line) outputs each sequence on a single line. Custom characters per line uses the Custom line length value. |
Custom line length | Number of sequence characters per output line when Custom characters per line wrapping is selected. Default: 80. Values are validated, so invalid entries fall back to standard 80-character wrapping. |
Case format | Letter case for output sequences. UPPERCASE (default) matches database expectations. lowercase for alternative formatting. Preserve original maintains input capitalization. |
Character cleanup | Master switch enabling automatic removal of non-sequence characters. Default: enabled. |
Remove spaces | Strips whitespace characters from sequences. Default: enabled. |
Remove numbers | Strips numeric characters (0-9) from sequences, useful for sequences copied from numbered formats. Default: enabled. |
Remove tabs | Strips tab characters from sequences. Default: enabled. |
Remove punctuation | Strips punctuation marks from sequences. Default: enabled. |
Preserve alignment gaps | Keeps - and . gap characters when converting aligned FASTA or MSA-style input. Default: disabled. |
Preserve stop codons | Keeps terminal * stop markers in protein, coding DNA, or RNA sequences. Internal * characters are still rejected during validation. Default: disabled. |
| Remove invalid characters | Strips characters that are not valid biological residues. This pass respects the Remove spaces, Remove numbers, Remove tabs, and Remove punctuation switches, so characters those switches keep are preserved here and reported by validation instead of being deleted silently. Type-specific residue removal only runs when a Sequence type is selected, so in auto-detect mode short proteins made mostly of nucleotide-overlap letters are not truncated. Default: enabled. |
Validate sequences | Performs a final check that all output characters are valid biological sequence codes for the selected sequence type. Default: enabled. |
Validation strictness | Lenient (auto-clean) removes invalid characters and reports what changed. Strict (reject invalid) fails any sequence that would require cleanup, including spaces, tabs, numbers, punctuation, non-letter characters, or sequence-type mismatches. |
Add line numbers to headers | Includes original line numbers from the input file in FASTA headers, useful for tracking sequence sources. Applies to generated headers and to preserved FASTA headers alike. Default: disabled. |
Retain record descriptions | Keeps the text after a FASTA identifier when headers are regenerated with any format other than Preserve existing headers, for example >seq_1 sp|P12345|INS_HUMAN Human insulin. Default: disabled. |
Results
The converter produces FASTA-formatted output that can be copied to clipboard or downloaded as a .fasta file. The final Logs tab shows conversion settings, sequence statistics, cleanup totals, and detailed cleanup or validation messages. The same run.log remains downloadable from Files.
| Output | Description |
|---|---|
| FASTA text | Properly formatted sequences with > headers and wrapped sequence lines. Each sequence appears on separate lines following its header. |
run.log | Conversion settings, sequence statistics, cleanup totals, and processing details, shown in Logs and available as a plain-text download. |
How to make a FASTA file from a TXT file
While using ProteinIQ's TXT to FASTA converter is the simplest way, you can also convert a plain text file to FASTA manually by adding a header line that starts with > and placing the sequence on the next line. This is the standard way to create a FASTA file from raw sequence text before saving it with a .fasta or .fa extension.
Edit the file in a text editor
For small files, open the .txt file in a plain text editor such as Notepad or TextEdit and format each sequence like this:
>Sequence_1
MTEITAAMVKELRESTGAGMMDCKNALSETQHEWAYKIf your file contains multiple sequences, repeat the same pattern for each entry:
>Sequence_1
MTEITAAMVKELRESTGAGMMDCKNALSETQHEWAYK
>Sequence_2
MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFHow to save a FASTA file
After formatting the header and sequence lines, use Save As in a text editor and save the file as plain text with a .fasta or .fa extension. If the editor appends .txt, choose plain text output explicitly and rename the file so the final filename ends in .fasta or .fa.
Use a converter when the input is messy
If the text contains numbering, spaces, or inconsistent formatting, use a dedicated converter to clean the sequences and generate headers automatically. ProteinIQ supports pasted text and uploaded files, so it is useful when manual editing would be slow or error-prone.
FASTA format rules
FASTA files are simple, but a few rules matter for downstream tool compatibility.
- Header line: Each sequence starts with a single header line beginning with
>. The identifier should be unique within the file. - Sequence line: Put the sequence directly below the header. Many tools accept wrapped lines, but one continuous line per sequence is often easier to inspect.
- Valid characters: Use standard nucleotide codes such as
A,C,G,T,U, andN, or standard one-letter amino acid codes for proteins. - Alignment gaps: Gapped alignment FASTA files may contain
-or.gap characters. EnablePreserve alignment gapswhen converting aligned sequences. - Protein stops: Translated protein FASTA records sometimes end with
*to mark a stop codon. EnablePreserve stop codonsif you need to keep that terminal marker. - No numbering or spaces: Remove residue numbers, tabs, spaces, and other non-sequence characters unless a tool explicitly allows them.
- Plain text file: Save the file as plain text before renaming it to
.fastaor.fa.
Which FASTA converter should I use?
Use TXT to FASTA when your input is a plain text sequence, copied sequence block, or .txt file. Use a more specific converter when the source file has a structured format with metadata or quality scores.
| Input format | Best converter | Use when |
|---|---|---|
| TXT or pasted sequence text | TXT to FASTA | You need to create a FASTA file from raw DNA, RNA, or protein text. |
| CSV or spreadsheet-like text | CSV to FASTA | Sequence IDs and sequences are stored in columns. |
| FASTQ sequencing reads | FASTQ to FASTA | You need to remove quality-score lines from sequencing-read data. |
| GenBank records | GenBank to FASTA | You want sequence records from annotated GenBank files. |
| GenBank feature tables | GenBank Feature Extractor | You need coding sequences, genes, or other annotated features before FASTA conversion. |
| PDB structure files | PDB to FASTA | You need the amino acid sequence from a protein structure. |
FAQ
How do I convert a text file to FASTA format?
Upload the .txt file or paste its contents, choose DNA, RNA, Protein, or Auto-detect, and run the converter. The result can be copied or downloaded as a .fasta file with headers and wrapped sequence lines.
How do I save a TXT file as FASTA?
Add a header line that starts with > above each sequence, put the sequence on the next line, and save the file as plain text with a .fasta or .fa extension. If your editor appends .txt, rename the file so it ends in .fasta or .fa. This converter can generate the headers and the downloaded file for you.
What characters are valid in DNA, RNA, and protein FASTA?
DNA uses A, C, G, T, and ambiguity codes such as N, R, and Y. RNA uses U in place of T. Protein uses one-letter amino acid codes such as A, C, D, E, and M, plus ambiguity and extended codes such as X, B, Z, J, O, and U.
Can FASTA contain gaps?
Yes. Aligned FASTA files often contain - or . gap characters to keep homologous positions in the same columns, while raw unaligned FASTA usually should not. Enable Preserve alignment gaps when your input is already an alignment.
How do I convert a sequence that spans multiple lines?
Choose Join all lines into one sequence under Multi-sequences, or Split on empty lines if your file separates records with blank lines. Auto-detect treats every raw line as its own record, which suits lists of short sequences but would split one wrapped sequence into pieces. Input that starts with > headers is unaffected because each FASTA record always stays whole.
What happens to duplicate sequence names?
If two records produce the same header, the converter appends _2, _3, and so on to later duplicates so every identifier in the output FASTA stays unique.
Should I use TXT to FASTA or FASTQ to FASTA?
Use TXT to FASTA for raw sequences copied from notes, spreadsheets, or plain text files. Use FASTQ to FASTA when your input is sequencing-read data, since FASTQ includes quality-score lines that need a dedicated converter to strip.
Related tools

CSV to FASTA
Convert CSV and TSV files containing sequence data to FASTA format with flexible column mapping and automatic delimiter detection

GenBank Feature Extractor
Extract sequence features (CDS, mRNA, gene, etc.) from GenBank files in FASTA format with support for spliced features

FASTA to FASTQ Converter
Convert FASTA sequence files to FASTQ format with mock quality scores

FASTQ to FASTA converter
Convert standard FASTQ reads to FASTA with validation, IUPAC nucleotide support, average-quality filtering, and downloadable summaries

GenBank to FASTA Converter
Convert GenBank files to FASTA format

DNA to Protein Converter
Translate DNA sequences to protein sequences using genetic code

DNA to RNA converter
Convert DNA sequences to RNA (transcription) - replaces T with U

Protein to DNA converter
Reverse translate protein sequences to possible DNA sequences

RNA to DNA converter
Convert RNA sequences to DNA (reverse transcription) - replaces U with T

Reverse complement generator
Generate reverse, complement, or reverse-complement of DNA/RNA sequences in raw, FASTA, or FASTQ format