How to open a PDB file

View it in 3D, or read the text line by line

11 min

The first records of the ubiquitin PDB file 1UBQ beside its C-alpha trace, with the Met1 CA atom line linked to that atom.

To open a PDB file, load it into a molecular viewer: drop it onto the PDB viewer in any browser, or open it in desktop software such as PyMOL, UCSF ChimeraX or VMD with File, then Open. The structure appears in 3D, and you can rotate it, zoom in and click residues. A PDB file is also plain text, so Notepad or TextEdit opens it too, and every atom is one readable line.

This is the start of the ubiquitin entry 1UBQ, downloaded from the RCSB Protein Data Bank:

Text
HEADER    CHROMOSOMAL PROTEIN                     02-JAN-87   1UBQ
TITLE     STRUCTURE OF UBIQUITIN REFINED AT 1.8 ANGSTROMS RESOLUTION
COMPND    MOL_ID: 1;
COMPND   2 MOLECULE: UBIQUITIN;
COMPND   3 CHAIN: A;
...
ATOM      1  N   MET A   1      27.340  24.430   2.614  1.00  9.67           N
ATOM      2  CA  MET A   1      26.266  25.413   2.842  1.00 10.38           C

The text is how the file stores the structure; the viewer is how you see it. Which one you need depends on the question. To look at a fold or a binding pocket, use a viewer. To find a resolution, a chain name or the coordinates of one atom, the text is often faster.

First, check that it is a protein structure

The .pdb extension has two unrelated owners. Microsoft compilers write debugging information for programs into a separate program database file, also called a PDB and saved as .pdb.[3] These files sit next to .exe and .dll files in software folders, and no molecular viewer can open them.

To tell the two apart, open the file in Notepad or TextEdit. A structure file shows lines of capital letters and numbers starting with words such as HEADER, REMARK or ATOM. A debug symbol file starts with Microsoft C/C++ MSF 7.00 followed by unreadable binary characters. If you found the file in a program's install folder and you are not debugging that program, you can leave it alone.

How to open a PDB file online

The quickest route needs nothing installed. The PDB viewer on ProteinIQ reads the file in your browser and draws it with Mol*, the same viewer engine the RCSB PDB uses on its entry pages.[7]

  1. Go to the PDB viewer.
  2. Click Click to upload and choose your .pdb file, or drag the file onto the upload area.
  3. Drag to rotate the structure, scroll to zoom, and hover over an atom to see its residue, chain and number.
  4. To find a specific residue, click it in the sequence strip above the structure.
Figure 1. Ubiquitin (1UBQ) in the PDB viewer. The protein opens as a cartoon, the 58 crystallographic waters as red dots, and the components panel lists both so either can be hidden.

The file is read on your own computer and is not uploaded to a server, so there is no account or size quota. The same page opens mmCIF (.cif), PDBQT, SDF, MOL2, XYZ and GROMACS .gro files, and several files can be loaded into one scene, such as a receptor and a docked ligand. If you only have a four-character PDB ID, PDB download fetches the entry first.

How to open a PDB file in PyMOL, ChimeraX or VMD

Desktop programs are the better choice for publication figures, electron density maps and long sessions. All three below run on Windows, macOS and Linux, and all three can also download an entry by its ID.

PyMOL

  1. Click File, then Open..., and choose the .pdb file.
  2. Or type load 1ubq.pdb at the PyMOL> prompt, using the path to your file.
  3. To download an entry instead, type fetch 1ubq.

fetch downloads mmCIF by default since PyMOL 1.8. Add type=pdb, as in fetch 1ubq, type=pdb, if you need the legacy PDB file.[5] Open-source PyMOL is free; Schrödinger sells licensed builds with installers and support.

UCSF ChimeraX

  1. Click File, then Open, and choose the file.
  2. Or type open 1ubq.pdb in the command line at the bottom of the window.
  3. To download an entry from the RCSB PDB, type open 1ubq.

As with PyMOL, ChimeraX fetches the mmCIF version by default; open 1ubq format pdb gets the PDB file instead.[4] ChimeraX is free for academic, nonprofit and personal use.

VMD

  1. In the VMD Main window, click File, then New Molecule. The Molecule File Browser opens.
  2. Click Browse... and choose the .pdb file.
  3. Check that the file type reads PDB, then click Load.

Nothing is loaded until you click Load. Typing a four-letter PDB ID into the file name field instead of browsing downloads the entry from the PDB.[6] From the Tk Console, mol new 1ubq.pdb does the same as the steps above.

How to open a PDB file on Windows 10 or 11

Windows has no default program for structure files. Double-clicking a .pdb file either asks which app to use or, on computers with Visual Studio installed, opens it in Visual Studio, which registers the extension for its debug symbol files.

  1. Right-click the file and choose Open with, then Choose another app.
  2. Pick PyMOL, ChimeraX or VMD if you have one installed, or Notepad to read the text.
  3. To make the choice permanent, go to Settings, then Apps, then Default apps, search for .pdb and choose the app.

Downloads from the PDB archive sometimes arrive compressed as 1ubq.pdb.gz or pdb1ubq.ent.gz. Extract them first with an archive tool such as 7-Zip, then open the .pdb or .ent file inside.

How to open a PDB file on a Mac

macOS also has no built-in structure viewer. Install PyMOL or ChimeraX from their official sites and open the file from File, then Open, or use the browser PDB viewer, which works in Safari. To read the text, Control-click the file, choose Open With, then TextEdit. Double-clicking a .pdb.gz file in Finder extracts it with Archive Utility.

How to read a PDB file in a text editor

Any plain-text editor opens a PDB file. Notepad, TextEdit, VS Code and Notepad++ all work; Word does not, because its proportional font breaks the columns that hold the data. On the command line, head -20 1ubq.pdb shows the header and grep ^ATOM 1ubq.pdb lists every protein atom.

Each line is one record, and the first six characters name the record type. A typical X-ray entry such as 1UBQ contains these, in this order:

RecordWhat it holdsIn 1UBQ
HEADERClassification, deposition date, PDB IDCHROMOSOMAL PROTEIN, 02-JAN-87, 1UBQ
TITLETitle of the studySTRUCTURE OF UBIQUITIN REFINED AT 1.8 ANGSTROMS RESOLUTION
COMPND, SOURCEMolecule names, chains, source organismUbiquitin, chain A, Homo sapiens
EXPDTAExperimental methodX-RAY DIFFRACTION
REMARKNumbered notes; REMARK 2 is the resolution, REMARK 465 lists missing residuesRESOLUTION. 1.80 ANGSTROMS.
SEQRESFull sequence of each chain, including residues without coordinates76 residues, MET GLN ILE PHE ...
HELIX, SHEETSecondary structure2 helices, 5 strands
ATOMCoordinates of standard protein and nucleic acid atoms602 lines
HETATMCoordinates of everything else: ligands, ions, water, modified residues58 waters (HOH)
TER, ENDEnd of a chain, end of the fileTER 603 GLY A 76

ATOM and HETATM columns

ATOM and HETATM lines use the same fixed columns, so a field is defined by character position, not by spaces.[1] This is the first atom of ubiquitin, the backbone nitrogen of methionine 1:

Text
ATOM      1  N   MET A   1      27.340  24.430   2.614  1.00  9.67           N
ColumnsFieldValue in this line
1-6Record typeATOM
7-11Atom serial number1
13-16Atom nameN (backbone nitrogen; CA is the alpha carbon)
17Alternate locationblank
18-20Residue nameMET
22Chain identifierA
23-26Residue number1
27Insertion codeblank
31-54x, y, z coordinates in ångströms27.340, 24.430, 2.614
55-60Occupancy1.00
61-66B-factor (temperature factor)9.67
77-78ElementN

Because the format is fixed width, neighboring fields can run together when a number fills its whole field, for example a coordinate of -100 or below, which leaves no space before the next coordinate. Software reads by position and gets it right; splitting the line on spaces does not.

The B-factor column also carries other numbers in some files. AlphaFold and other structure predictors write per-residue pLDDT confidence there, so a high value in a predicted model means confident, not mobile.

Chains, models and missing residues

The chain identifier in column 22 is a single character, which is why a PDB file can hold at most 62 chains (A to Z, a to z, 0 to 9). Each chain ends with a TER record. NMR entries contain several models of the same molecule, each wrapped in MODEL and ENDMDL lines; viewers show the first one or all of them as an ensemble.

SEQRES lists the sequence the scientists put in the crystal, while the ATOM lines contain only residues that were resolved. When the two differ, the missing residues are listed under REMARK 465 and appear as gaps in the viewer. PDB to FASTA extracts the sequence of each chain from either source, and PDBFixer rebuilds missing atoms and residues before docking or simulation.

PDB vs mmCIF

Much of what you download from the PDB today is not a PDB file. The legacy PDB format was frozen at version 3.30 in 2012, and PDBx/mmCIF (.cif) has been the archive's standard format since 2014.[2] Fixed columns put hard limits on what a PDB file can hold: 99,999 atoms and 62 chains. Entries larger than that, such as ribosomes and many cryo-EM complexes, are distributed only as mmCIF.[2]

mmCIF stores the same atoms as a table with named columns separated by spaces. The same ubiquitin atom in 1ubq.cif reads:

Text
ATOM   1   N N   . MET A 1 1  ? 27.340 24.430 2.614  1.00 9.67  ? 1   MET A N   1

The meaning of each column is declared above the table in _atom_site lines, so nothing depends on character position. Every viewer named here opens both formats. When an older program accepts only one of them, PDB to CIF converts PDB files to mmCIF in the browser.

Common problems when opening PDB files

ProblemSymptomFix
The file is a Windows debug symbol fileBinary characters in Notepad; viewers report an unreadable fileCheck where the file came from; structure files are text that starts with HEADER or ATOM
The file is compressedName ends in .gz or .ent.gz; viewers reject itExtract it first, then open the .pdb or .ent file
The entry has no PDB fileRCSB offers only mmCIF for the downloadOpen the .cif file, which every viewer here reads
Opened in WordColumns misaligned, coordinates look wrongUse a plain-text editor or a viewer
Water hides the proteinRed dots surround the structureHide the water component in the viewer, or remove HOH lines
Gaps in the chainBreaks in the cartoon where loops should beResidues are missing from the experiment; check REMARK 465 or rebuild them with PDBFixer

What to do after opening it

Once the structure is open, the next steps usually check or reuse it. MolProbity scores clashes and geometry, and the Ramachandran plot flags backbone outliers. PDB to SDF pulls ligands out for cheminformatics, and a cleaned receptor goes into AutoDock Vina; the AutoDock Vina tutorial walks through preparing one. To compare a predicted model with an experimental structure, RMSD is the usual first number.

FAQ

What program opens a PDB file?

Any molecular viewer: PyMOL, UCSF ChimeraX, VMD, Jmol, or a browser viewer such as the ProteinIQ PDB viewer. Any plain-text editor shows the underlying text.

Can I open a PDB file online without installing anything?

Yes. The PDB viewer opens .pdb and .cif files in the browser, reads them locally and needs no account.

Why does my PDB file open in Visual Studio?

On Windows, Visual Studio registers the .pdb extension for its program database files. Right-click the structure file, choose Open with, then Choose another app, and pick a molecular viewer or Notepad.

What is the difference between .pdb and .ent files?

None in content. The wwPDB archive names its PDB-format files pdb1ubq.ent, and RCSB entry pages offer the same data as 1ubq.pdb. Rename .ent to .pdb if a program filters by extension.

How do I find the resolution in a PDB file?

Search the text for REMARK 2. In 1UBQ it reads RESOLUTION. 1.80 ANGSTROMS. NMR entries have no resolution, and the EXPDTA line says SOLUTION NMR instead.