Skip to content

Import XYZ coordinates

A geometry optimization gives you a list of atoms and their x, y, and z coordinates. The XYZ importer reads that list (the contents of any .xyz file), works out which atoms are bonded and with what bond orders, and lays the molecule out flat as a new drawing you can edit like any other. The 2D layout is built from the bonds, not by flattening the 3D coordinates. For MOL and SDF files, see Import MOL and SDF files instead.

Select File > Import XYZ…, or click the XYZ button in the action bar, immediately to the left of the Templates button. Both open the Import XYZ coordinates dialog. The command palette (Ctrl+K) finds it under “Import XYZ”. There is no keyboard shortcut.

The dialog has no file picker. To import a file, open it in a text editor, copy its contents, and paste them into the text box. You can drag the dialog by its title bar.

To build the structure, click Import or press Ctrl+Enter (Cmd+Enter on a Mac). Cancel or Esc closes the dialog. If nothing in the box can be read as coordinates, the border of the box turns red and asks for El x y z lines, and nothing is imported until the text is valid.

  1. Select File > Import XYZ….

  2. Paste these lines:

    3
    water
    O 0.000 0.000 0.117
    H 0.000 0.757 -0.467
    H 0.000 -0.757 -0.467
  3. Turn on Show lone pairs and click Import.

Water appears with two lone pairs on the oxygen. Because Show explicit hydrogens is off, the two hydrogens are folded into the label of the oxygen. To draw each H as its own atom, import again with Show explicit hydrogens on.

Checkbox Default Effect
Show explicit hydrogens Off Off gives a bond-line drawing with hydrogens folded into their heavy atoms. On draws every hydrogen in the file as its own atom.
Show stereochemistry On Adds solid and hashed wedges at stereocenters, so the flat drawing keeps the chirality of the 3D geometry. It applies to the bond-line drawing, so it is unavailable while explicit hydrogens are shown.
Show lone pairs Off Places lone pairs at idealized VSEPR positions, such as the two on the oxygen of water or the one on the nitrogen of ammonia.

Coordinates alone do not say which atoms are bonded or how, so the importer works out the chemistry from the atom positions.

  • Bonds. Two atoms are bonded when they are closer than a fixed multiple of the sum of their tabulated covalent radii.
  • Bond orders. Single, double, or triple bonds are assigned so that each atom reaches its expected valence. For example, benzene arrives as a Kekulé ring of alternating double bonds.
  • Layout. The 2D layout is built from the connectivity. Chains run as a horizontal zigzag, and linear centers such as alkynes, nitriles, and carbon dioxide are drawn straight, at 180°. Fused, bridged, and spiro ring systems are laid out so that nothing overlaps.
  • Charges. An atom with more single bonds than its neutral valence is given the charge of the ion: N+ in ammonium and tetramethylammonium, O+ in hydronium, S+ in trimethylsulfonium, B− in tetrafluoroborate, and P− in hexafluorophosphate. Neutral hypervalent molecules such as PCl5 and SF6 stay neutral.
  • Stereochemistry. Stereochemistry comes from the 3D coordinates. Tetrahedral centers get solid and hashed wedges, and double bonds are drawn with the correct E or Z (cis or trans) geometry.

The importer draws exactly the hydrogens in the file and adds none of its own. A carbon written with three hydrogens stays a carbon with three hydrogens; it is not completed to a methyl group. A file with heavy atoms only imports with no hydrogens. Deuterium and tritium (written D or T) are kept as labeled hydrogen isotopes.

  • Standard .xyz has a count on the first line, a comment or name on the second, then one element x y z line per atom.
  • A list of element x y z lines without those two header lines also works.
  • Elements may be symbols (in any case) or atomic numbers.
  • A Gaussian-style extra column between the symbol and the coordinates is ignored.
  • A numbered label such as C1 or H12, as some programs write, is read as its element.
  • Entries that calculation outputs sometimes contain, such as ghost atoms, point charges, and translation vectors, are dropped, so the file needs no cleaning first.
  • Any other line that cannot be read as an atom is left out, and a warning says how many lines were left out.

A file can have up to 500 atoms. A larger file is not imported, and a warning gives its atom count and the limit.

Bond-order perception is tuned for neutral, closed-shell organic molecules. Aromatic rings arrive in a single Kekulé form, and charged, radical, hypervalent, or organometallic species may need editing after import. The distance threshold for a bond is fixed, so an unusually long polar bond can occasionally be missed. Treat the imported structure as a normal drawing and correct anything the perception got wrong.