What is the XYZ file format?
.xyz is a plain-text file format supported by various chemistry programs. .xyz files store molecule data in plain text: the number of atoms (line 1), a free-form comment (line 2), and one line per atom with an element symbol and X, Y, and Z coordinates in angstroms. Although .xyz has no formal specification, it is widely used - a de facto community standard originating with the XMol program in the early 1990s.
The format stores only element symbols and coordinates; it carries no bond orders, partial charges, or unit-cell data by default. A popular extension called extended XYZ (extxyz) adds key=value metadata on the comment line. Multiple blocks can be concatenated in one file to store a trajectory. The MIME type is chemical/x-xyz.
The .xyz extension is not used exclusively by chemistry programs. It is not uncommon to see text files of any kind saved with an .xyz suffix. Before working with .xyz files, it is advised to turn off Windows' "hide extensions for known file types" option to avoid file-identification issues. Related formats include .mol, .pdb, and .cif.
Security & safety
RISK: LOWAn XYZ file is plain text containing only atom labels and numbers - no executable content, no macros - so it is essentially harmless to open. The only practical caveat is mistaken identity: a .xyz might actually be GPS/survey point data or a Wii game image rather than a molecule, in which case a chemistry viewer will fail or show nonsense; check the file's source. Download chemistry tools from their official sites (avogadro.cc, openbabel.org).
Format details
in a nutshell- GPS / surveying point data (.xyz) - A plain-text list of easting/northing/elevation or longitude/latitude/altitude points used by GIS and surveying tools; structurally just delimited numbers, not chemistry.
- Nintendo Wii image (.xyz) - An RLE-compressed indexed bitmap image format found in some Wii games; unrelated to the molecular format.
Programs that open XYZ files
Technical details
deep spec| MIME type | chemical/x-xyz |
| Alternate MIME type | text/plain |
| Encoding | Plain text - ASCII or UTF-8 |
| File structure | Line 1: integer atom count; line 2: free-form comment; each following line: element symbol and three floating-point x, y, z values |
| Coordinate unit | Angstroms (Å) by default |
| Coordinate system | Cartesian (absolute x, y, z positions) |
| Bond data | Not stored; only element symbols and atomic positions are recorded |
| Extended variant | Extended XYZ (extxyz): key=value metadata pairs and a Lattice= tensor written to the comment line |
| Multi-frame support | Yes - multiple coordinate blocks concatenated in one file form a trajectory or animation |
| File signature | None (no magic bytes); identified by an integer on the first line followed by a comment and element-symbol lines |
| Compression | Uncompressed by default; large trajectories are commonly gzip-compressed as .xyz.gz |
| Typical file size | A few hundred bytes for small molecules; hundreds of MB for long molecular-dynamics trajectories |
| Platform | Cross-platform - identical format on Windows, macOS, and Linux |
| Origin | XMol molecular visualization program, Minnesota Supercomputer Center, early 1990s |
| Released | Early 1990s (XMol) |
| Latest version | No formal version - a stable de facto text format; 'extended XYZ' adds metadata |
| Open standard | Yes · royalty-free |
| Specification | en.wikipedia.org |
XYZ conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about XYZ files.