Converting smiles into 3D structures using openbabel.

2 mins read

Openbabel is used to inter-convert many file formats [1]. It is available for Linux, Windows, and MAC operating systems. In this article, we will learn how to generate 3D structures of compounds present in the form of smiles on Ubuntu as well as on Windows.

On Ubuntu

You can download the openbabel software on Ubuntu from the repository as shown below:

$ sudo apt-get install openbabel.

Save your downloaded smiles into smiles format (.smi), for example, ‘smiles.smi’. This is our input file. To generate 3D structures of these smiles into SDF format, type the following commands:

$ obabel -i smi smiles.smi -o sdf -O out.sdf -m -h --gen3d

Here, -m is used to split the output into multiple files. It is used in batch conversion, where you have multiple smiles in a single file (as described in this article) and you want individual files as output. -h adds hydrogens.

--gen3d is used to generate 3D coordinates for the structure.

Similarly, they can be converted into pdb as well as shown below:

$ obabel -i smi smiles.smi -o pdb -O out.pdb -m -h --gen3d

You can also convert files other than smiles. For example, pdb, mol, SDF, and so on. Just change the input-ID and input filename along with the output-ID and output filename according to your requirements.

For more options, type $ obabel -H.

On Windows

On Windows, you can download the binary file from here. You can use the GUI of openbabel as follows.

  1. Open the openbabel after installation.
  2. Upload your input file and specify the input format from the dropdown.
  3. Select options appropriate to your needs such as ‘Generate 3d’, ‘Output multiple conformers separately’, and so on.
  4. Select the output format and output file location.
  5. Click ‘Convert’.

You can input smiles or any other format using the editor given on the left side of GUI and obtain output without saving into any files.


  1. O’Boyle, N. M., Banck, M., James, C. A., Morley, C., Vandermeersch, T., & Hutchison, G. R. (2011). Open Babel: An open chemical toolbox. Journal of cheminformatics3(1), 33.


Tariq is founder of Bioinformatics Review and a professional Software Developer at IQL Technologies. His areas of expertise include algorithm design, phylogenetics, MicroArray, Plant Systematics, and genome data analysis. If you have questions, reach out to him via his homepage.

Leave a Reply

single-cell rna-seq
Previous Story

Most widely used web servers/software for single-cell RNA-seq analysis

extact fasta sequences using perl
Next Story

Extract FASTA sequences based on sequence length using Perl

Latest from Tools

0 $0.00