SeqBench

How to Open a GenBank (.gb / .gbk) File

10 min read · Updated September 12, 2026

Someone sends you a .gb file, or you download one from NCBI, and double-clicking it either does nothing or opens a text editor full of what looks like a printout from 1985. The text editor is closer to right than it looks: a GenBank file is plain text, deliberately, and it has been readable that way since before there was a web to download it from.

What a text editor will not do is draw the map, and drawing the map is usually the point. This guide covers what is actually inside the file, how to read the header and the FEATURES table by eye, the small location language that trips people up, what to do when a record has no annotation at all, and how to get a plain sequence back out.

It is text, and it has three parts

Open a .gb in any text editor and you will see a record with a fixed shape. The header runs from the LOCUS line down to the last reference. Then FEATURES introduces a table of annotations. Then ORIGIN introduces the sequence itself, and a line containing only // ends the record.

A single file may hold more than one record, stacked one after another, each ending in its own //. This is worth knowing because a tool written for single records will often read only the first one and say nothing about the rest.

The extensions are all the same format. .gb, .gbk, .genbank, .gbff and .ape are GenBank flat files; .gp is the same layout for a protein record. ApE, the free plasmid editor, writes ordinary GenBank under its own extension. None of these need converting to each other — a reader that opens one opens all of them.

Reading the LOCUS line

The first line is dense and fixed-width, and it carries five things you usually want before anything else. For NCBI's pUC19 record it reads:

LOCUS SYNPUC19CV 2686 bp DNA circular SYN 22-MAY-2002

The first field is the locus name, and note that it is SYNPUC19CV rather than pUC19 — locus names are an internal identifier and frequently bear no resemblance to the name anyone uses. Then the length, 2,686 bp. Then the molecule type. Then the topology, circular, which is the field that matters most for a plasmid: a tool that misses it will refuse to find features spanning the origin and will compute the wrong fragment sizes for a digest. Then the division code and the date.

Two lines below, ACCESSION reads L09137 X02514 — two accessions, because records get merged. VERSION reads L09137.2, and a COMMENT further down records that this version replaced L09137.1 in 2002. GenBank records are revised, so a file someone saved years ago may not match what the same accession returns today.

FEATURES is the part you actually want

Everything that makes a GenBank file more useful than a FASTA lives in the FEATURES table. Each entry is a type (CDS, gene, promoter, misc_feature, source), a location, and a block of qualifiers beginning with a slash: /gene, /product, /note, /translation, /codon_start.

Now the part that surprises people. Here is the complete FEATURES table of NCBI's canonical pUC19 record, L09137.2 — the reference entry for the single most widely used cloning vector in existence:

FEATURES Location/Qualifiers — source 1..2686, /organism, /mol_type, /db_xref. That is all of it. One feature, covering the whole molecule, saying only that this is a cloning vector.

No AmpR. No origin of replication. No lacZ-alpha, no lac promoter, no multiple cloning site. Open that file in a viewer and you get a circle with one band around the entire circumference, which looks like the viewer is broken and is not.

This is normal rather than exceptional for older sequence-database records, and it explains a lot of confusion. A plasmid map you have seen in a paper or in SnapGene is annotation that somebody added on top of the sequence; it is not in the sequence and it is frequently not in the database record either.

Locations are a small language

A feature's location is not always a pair of numbers, and the forms beyond 1..2686 are where hand-written parsers break.

complement(70..80) means the feature is on the minus strand. join(1..100,320..360) means the feature is assembled from those pieces in that order — this is how a spliced CDS is written, and it is also how a feature that crosses the origin of a circular plasmid is written, with the piece at the end of the sequence listed first. order(...) looks like join but does not assert that the parts are contiguous in the product.

The angle brackets in <1..206 mean the feature continues past the start of the sequence — the record has a partial feature, not a feature starting at base 1. Writing that off as 1..206 silently turns a fragment into a complete gene.

Two more that look like typos and are not: 102.110 with a single dot means one base somewhere in that range, and 102^110 with a caret means the position between two bases, used for insertion sites. And a location can point at another record entirely, as in J00194.1:100..202.

SeqBench's GenBank parser handles all of these, including complement wrapped around a join, joins that cross the origin on a circular molecule, and the partial markers — which matters because getting any of them wrong produces a feature drawn in the wrong place rather than an error message.

Open it in a browser

The GenBank Viewer reads a .gb or .gbk in a browser tab with no install and no account. It parses the header, lists the features with their types, strands and coordinates — flagging the partial ones whose sequence the file only holds part of — and hands you the sequence. To pull out the CDS features specifically, or their translated proteins, the Format Converter is the tool with that output mode.

You can also drop a GenBank file anywhere on SeqBench and it will be recognised and routed to the page that opens it, which saves hunting for the right tool first.

Worth being straight about what a viewer cannot do: it shows you what is in the file. If the file has one feature, you get one feature. That is not the end of the road, though, because annotation can be added.

Annotating a record that has none

For the pUC19 case above, the sequence is complete and correct — it is only the annotation that is missing, and annotation can be recomputed from the sequence by matching it against a library of known elements.

Running the 2,686 bases of L09137 through the Plasmid Annotator returns nine features across six types where the record carried one: the multiple cloning site at 396-422, both M13 sequencing primer sites, the lac operator at 487-507, the lac promoter -10 element, the CAP binding site, the pMB1/ColE1 origin at 1338-1369, and AmpR with its promoter.

Seven of those nine are on the minus strand, which is a nice independent check on the annotation: the record's own COMMENT block describes pUC19c as having the beta-galactosidase mRNA on the complementary strand, and the annotation agrees without having been told.

That is the general workflow for an unannotated or thinly annotated record — open it, see what is there, annotate to fill in what is not, and export the result as a GenBank file that now carries the features.

Getting the sequence out

Often all you want is the bases, in FASTA, to paste into something else. The ORIGIN block is not directly usable for that: it is wrapped at 60 characters with a running coordinate at the start of each line and a space every ten bases, all of which has to be stripped.

The Format Converter takes a GenBank record and returns FASTA, and it will also extract just the CDS features, or translate them and return the protein sequences, which is the fast route from an annotated record to the proteins it encodes. TSV output is there for when you want the feature table itself in a spreadsheet rather than the sequence.

Going the other way — FASTA to GenBank — produces a valid record with a header and a sequence but no features, for the same reason that FASTA to FASTQ produces no real quality: the information was never there.

GenBank, FASTA and .dna are not interchangeable

A FASTA file holds sequence and a name. A GenBank file holds sequence, a name, topology, and a feature table. A SnapGene .dna file holds all of that plus the things SnapGene needs to draw its own view — colours, display state, primer records, a history of the cloning operations that produced the file, and in some versions notes.

Converting downwards loses information silently and permanently. A .dna exported as GenBank keeps the features but not the display state; a GenBank exported as FASTA keeps only the sequence. Neither conversion warns you, and neither is reversible.

So keep the richest file you were given as the archive copy and convert on the way out, not on the way in. If a collaborator sends a .dna and you convert it to FASTA to paste into a tool, keep the .dna — it is the only copy of the annotation.

Frequently asked questions

How do I open a .gb or .gbk file?

Any text editor will show you the contents, because GenBank is a plain-text format. To see it as a map, use a viewer: SeqBench's GenBank Viewer opens .gb, .gbk and the other GenBank extensions in a browser tab with no install and no account, listing the features with their coordinates and strands. Dropping the file anywhere on the site also routes it there.

What is the difference between .gb, .gbk, .genbank and .ape?

Nothing — all of them are GenBank flat files under different extensions, and a reader that opens one opens all of them. .gbff is the same format used for NCBI's bulk release files, .gp is the protein-record layout, and .ape is what the ApE plasmid editor writes, which is ordinary GenBank. None of them need converting to each other.

Why does my GenBank file show no features?

Because the record does not contain any. This is common in older database entries — NCBI's canonical pUC19 record, L09137.2, has exactly one feature, a source entry covering the whole plasmid, with no AmpR, no origin and no MCS. The sequence is correct; only the annotation is missing. Run it through an annotator to recompute the features from the sequence.

What does complement(join(...)) mean in a feature location?

A feature on the minus strand assembled from several pieces — a spliced CDS on the reverse strand, or a feature crossing the origin of a circular plasmid. GenBank locations are a small language: complement() flips the strand, join() concatenates parts in the order given, <1..206 marks a feature that runs off the start of the record, 102.110 means one base somewhere in that range, and 102^110 means the position between two bases.

How do I convert a GenBank file to FASTA?

Use a converter rather than copying the ORIGIN block, which is wrapped at 60 characters with a coordinate at the start of each line and a space every ten bases. SeqBench's Format Converter takes GenBank and returns FASTA, and can also extract just the CDS features or return their translated proteins.

What does 'circular' on the LOCUS line change?

Whether features and fragments can wrap around position 1. A tool that treats a circular plasmid as linear will miss any feature spanning the origin and will compute the wrong fragment sizes for a digest. It is the field on the LOCUS line most worth checking, and the most commonly lost when a file is converted.

Is a GenBank file the same as a SnapGene .dna file?

No. GenBank is plain text holding sequence, topology and features. A .dna file is binary and holds all of that plus SnapGene's own display state, colours, primer records and cloning history. Exporting a .dna as GenBank keeps the features and discards the rest, silently and irreversibly — so keep the .dna as the archive copy and convert on the way out.

Can one GenBank file contain several sequences?

Yes. Records are stacked one after another, each ending in a line containing only //. Tools written for single records frequently read only the first and say nothing about the others, so it is worth checking the record count when a file is larger than you expected.

Related references

Related tools

Related guides