Spglib is a C library for finding and handling crystal symmetries.

Spglib-1.7.4.x. is the stable release.

Spglib-1.8.2.x is the latest release. This version is expected to be slightly faster and compact than the stable version, and the code is cleaner to be the base of future development. Update and change of definitions of variables can happen within versions 1.8.x and the change will be written in the document.

Version history is summarized in ChangeLog.


  • Find symmetry operations
  • Identify space-group type
  • Wyckoff position assignment
  • Refine crystal structure
  • Find a primitive cell
  • Search irreducible k-points
  • Liner tetrahedron method (the document is to be prepared.)


  • Space-group type finding algorithm: R. W. Grosse-Kunstleve, Acta Cryst., A55, 383-395 (1999)
  • Crystal refinement algorithm: R. W. Grosse-Kunstleve and P. D. Adams, Acta Cryst., A58, 60-65 (2002)


  1. Download spglib.

  2. Unzip, configure, and make:

    % tar xvfz spglib-1.7.4.tar.gz
    % cd spglib-1.7.4
    % ./configure
    % make
  3. Copy the libraries where you want using OpenMP. The libraries may be in src/.libs if you don’t make install,


Bottle neck of symmetry operation search may be eased using the OpenMP threading. In the case of gcc (> 4.2), set the following environment variables before running configure script:

% export LIBS='-lgomp'
% export CFLAGS='-fopenmp'

Overhead of threading is relatively large when the number of atoms is small. Therefore the threading is activated when the number of atoms >= 1000.


  1. Include spglib.h
  2. Link libsymspg.a or libsymspg.so
  3. A compilation example is shown in example/README.


A few examples are found in example <https://github.com/atztogo/spglib/tree/master/example>_ directory.


The ruby code symPoscar.rb in test directory reads a VASP POSCAR formatted file and finds the space-group type. The -l option refines a slightly distorted structure within tolerance spacified with the -s option. The -o option gives the symmetry operations of the input structure.

ruby symPoscar.rb POSCAR -s 0.1 -o -l

Some more options are shown with --help option:

ruby symPoscar.rb --help

The way to compile the ruby module is explained in test/README.

Python extension

Python extension for ASE is prepared in the python/ase directory. See http://spglib.sourceforge.net/pyspglibForASE/

Fortran interface

Fortran interface spglib_f08.f90 is found in example directory. This fortran interface is the contribution from Dimitar Pashov. spglib_f.c is obsolete and is not recommended to use.

Mailing list

For questions, bug reports, and comments, please visit following mailing list:


For more information


Spglib project acknowledges Yusuke Seto for the Crystallographic database and Dimitar Pashov for the fortran interface.