This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

XYZ (.xyz)

MIME type: chemical/x-xyz
XMOL molecule model files.
Used in cheminformatics applications and on the web for storing and exchanging 3D molecule models.
Plain text tabular format.
Represents a single chemical compound.
Stores atomic coordinates and meta-information.
Does not store chemical bond information.
Developed in 1990 at the Minnesota Supercomputer Center.
  • Import reads an XYZ molecule model and gives a visual representation of it.
  • Export exports elements of a molecule model to an XYZ file.
  • Import imports the specified element from an XYZ file.
  • Import imports multiple elements.
  • Export creates an XYZ file by treating expr as specifying element elem.
  • Export treats each as specifying the corresponding .
  • Export exports expr with the specified option elements taken to have the specified values.
  • Export uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
"Elements"list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties, and settings
  • Graphics element:
"Graphics3D"XYZ file rendered as a Graphics3D object
  • Import uses the element by default for the XYZ format.
  • Data representation elements:
"VertexCoordinates"atomic coordinates, typically given in picometers
"VertexTypes"all atoms or groups constituting the molecule, typically given as a list of chemical element abbreviations
  • Export creates an XYZ model from a specification of atom types and their 3D coordinates.
ImageSizeAutomaticspecifies the overall size of the graphics to display
BackgroundWhitespecifies what background color to use
ViewPointAutomaticpoint in space from which the 3D model is to be viewed
  • With the default setting Automatic, Mathematica automatically calculates the optimal viewing angle for the imported molecule model.
  • Selecting a 3D rendering style:
"Rendering""BallAndStick"specifies the visualization method
  • Possible settings for are:
"BallAndStick"displays atoms and bonds as a ball-and-stick model
"Spacefilling"atoms shown as overlapping spheres
"Wireframe"bonds rendered as lines
Import an XYZ example file, rendering it as a ball-and-stick model:
Show the same molecule as space-filling atoms:
Read the atom types and atom coordinates:
Export this data to XYZ:
Import an XYZ example file, rendering it as a ball-and-stick model:
In[1]:=
Click for copyable input
Out[1]=
Show the same molecule as space-filling atoms:
In[2]:=
Click for copyable input
Out[2]=
Read the atom types and atom coordinates:
In[3]:=
Click for copyable input
Out[3]=
Export this data to XYZ:
In[4]:=
Click for copyable input
Out[4]=