# How to open a PDB file

> Open a PDB file in your browser, in PyMOL, ChimeraX or VMD, or in a text editor on Windows and Mac, and learn to read its HEADER, ATOM and HETATM lines.

To open a PDB file, load it into a molecular viewer: drop it onto the [PDB viewer](/app/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](https://www.rcsb.org/structure/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`. 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](/app/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.

1. Go to the [PDB viewer](/app/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.

![The PDB viewer showing ubiquitin (1UBQ) as a green cartoon with red water oxygens, the chain A sequence above it and the Mol* structure tools panel on the right](/images/guides/open-pdb-file/ubiquitin-pdb-viewer.webp '**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](/app/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. 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. 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. 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](/app/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:

| Record | What it holds | In 1UBQ |
| --- | --- | --- |
| `HEADER` | Classification, deposition date, PDB ID | `CHROMOSOMAL PROTEIN`, `02-JAN-87`, `1UBQ` |
| `TITLE` | Title of the study | `STRUCTURE OF UBIQUITIN REFINED AT 1.8 ANGSTROMS RESOLUTION` |
| `COMPND`, `SOURCE` | Molecule names, chains, source organism | Ubiquitin, chain A, *Homo sapiens* |
| `EXPDTA` | Experimental method | `X-RAY DIFFRACTION` |
| `REMARK` | Numbered notes; `REMARK 2` is the resolution, `REMARK 465` lists missing residues | `RESOLUTION. 1.80 ANGSTROMS.` |
| `SEQRES` | Full sequence of each chain, including residues without coordinates | 76 residues, `MET GLN ILE PHE ...` |
| `HELIX`, `SHEET` | Secondary structure | 2 helices, 5 strands |
| `ATOM` | Coordinates of standard protein and nucleic acid atoms | 602 lines |
| `HETATM` | Coordinates of everything else: ligands, ions, water, modified residues | 58 waters (`HOH`) |
| `TER`, `END` | End of a chain, end of the file | `TER 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. 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
```
| Columns | Field | Value in this line |
| --- | --- | --- |
| 1-6 | Record type | `ATOM` |
| 7-11 | Atom serial number | `1` |
| 13-16 | Atom name | `N` (backbone nitrogen; `CA` is the alpha carbon) |
| 17 | Alternate location | blank |
| 18-20 | Residue name | `MET` |
| 22 | Chain identifier | `A` |
| 23-26 | Residue number | `1` |
| 27 | Insertion code | blank |
| 31-54 | x, y, z coordinates in ångströms | `27.340`, `24.430`, `2.614` |
| 55-60 | Occupancy | `1.00` |
| 61-66 | B-factor (temperature factor) | `9.67` |
| 77-78 | Element | `N` |

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](/guides/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](/app/pdb-to-fasta) extracts the sequence of each chain from either source, and [PDBFixer](/app/pdb-fixer) 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](/guides/cif-file) (`.cif`) has been the archive's standard format since 2014. 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.

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](/app/pdb-to-cif) converts PDB files to mmCIF in the browser.

## Common problems when opening PDB files

| Problem | Symptom | Fix |
| --- | --- | --- |
| The file is a Windows debug symbol file | Binary characters in Notepad; viewers report an unreadable file | Check where the file came from; structure files are text that starts with `HEADER` or `ATOM` |
| The file is compressed | Name ends in `.gz` or `.ent.gz`; viewers reject it | Extract it first, then open the `.pdb` or `.ent` file |
| The entry has no PDB file | RCSB offers only mmCIF for the download | Open the `.cif` file, which every viewer here reads |
| Opened in Word | Columns misaligned, coordinates look wrong | Use a plain-text editor or a viewer |
| Water hides the protein | Red dots surround the structure | Hide the water component in the viewer, or remove `HOH` lines |
| Gaps in the chain | Breaks in the cartoon where loops should be | Residues 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](/app/molprobity) scores clashes and geometry, and the [Ramachandran plot](/app/ramachandran-plot) flags backbone outliers. [PDB to SDF](/app/pdb-to-sdf) pulls ligands out for cheminformatics, and a cleaned receptor goes into [AutoDock Vina](/app/autodock-vina); the [AutoDock Vina tutorial](/guides/autodock-vina-tutorial) walks through preparing one. To compare a predicted model with an experimental structure, [RMSD](/guides/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](/app/pdb-viewer). Any plain-text editor shows the underlying text.

### Can I open a PDB file online without installing anything?

Yes. The [PDB viewer](/app/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.
