How do I convert a POSCAR-format-like file to a XSF file (visualized by XCrySDen)?

I'm looking for a step by step tutorial on the process and what tools/programs are needed.

  • 2
    $\begingroup$ Vesta can handle both POSCAR and XSF. Try opening the file in Vesta and exporting it. If that doesn't work, try searching for previous questions such as this, where the ASE package is used. $\endgroup$
    – PBH
    Commented Feb 3, 2022 at 1:15
  • 4
    $\begingroup$ Just type atomsk POSCAR xsf check documetation of atomsk atomsk.univ-lille.fr/doc/en/formats.html $\endgroup$ Commented Feb 3, 2022 at 7:58
  • $\begingroup$ @pranavkumar seems you can write an answer! $\endgroup$ Commented Feb 5, 2022 at 7:12

1 Answer 1


There are couple of tools which can quickly convert POSCAR to xsf format.


The basic syntax to convert POSCAR to xsf: atomsk POSCAR xsf


Inside the structure editor there is the option

406) Convert POSCAR/CONTCAR to Other Formats

The xsf format is one of the available options.


from ase.io import vasp
from ase.io import xsf

The above Python script should convert a POSCAR file to new.xsf You can also look at another python script which can convert other types of VASP files.

Custom Bash script

This GitHub repo made by user houzf has a bash script to do this conversion.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .