obabel - Man Page

a converter for chemistry and molecular modeling data files

Examples (TL;DR)

Synopsis

obabel-Hhelp-options
obabel[Options] [-iinput-type | -:SMILES-string] infile [-ooutput-type] -Ooutfile

Description

obabel is a cross-platform program designed to interconvert between many file formats used in molecular modeling and computational chemistry and related areas.

Open Babel is also a complete programmers toolkit for developing chemistry software. For more information, see the Open Babel web pages <https://openbabel.org/>.

Options

If only input and output files are given, Open Babel will guess the file type from the filename extension.

-:SMILES-string

Enter SMILES string and use it in place of an input file. The SMILES-string might need to be enclosed in quotation marks to avoid shell interpretation. More than one can be used, and a molecule title can be included if enclosed in quotes.

-aoptions

Format-specific input options. See -Hformat-ID for options allowed by a particular format

--addtotitle

Append text to the current molecule title

--addformula

Append the molecular formula after the current molecule title

-b

Convert dative bonds: e.g., [N+]([O-])=O to N(=O)=O

-c

Center atomic coordinates at (0,0,0)

-C

Combine molecules in first file with others having the same name

-e

Continue after errors

-d

Delete Hydrogens

---errorlevel n

Filter the level of errors and warnings displayed:
1 = critical errors only
2 = include warnings too (default)
3 = include informational messages too
4 = include “audit log” messages of changes to data
5 = include debugging messages too

-f #

For multiple entry input, start import with molecule # as the first entry

-F

Output the available fingerprint types

-h

Add hydrogens

-H

Output usage information

-Hformat-ID

Output formatting information and options for format specified

-Hall

Output formatting information and options for all formats

-iformat-ID

Specifies input format, see below for the available formats

-j, --join

Join all input molecules into a single output molecule entry

-k

Translate computational chemistry modeling keywords (e.g., GAMESS and Gaussian)

-m

Produce multiple output files, to allow:

  • Splitting one input file — put each molecule into consecutively numbered output files

  • Batch conversion — convert each of multiple input files into a specified output format

-l #

For multiple entry input, stop import with molecule # as the last entry

-oformat-ID

Specifies output format, see below for the available formats

-Ooutfile

Specify the output file

-p

Add Hydrogens appropriate for pH (use transforms in phmodel.txt)

--property

Add or replace a property (e.g., in an MDL SD file)

-s SMARTS

Convert only molecules matching the SMARTS pattern specified

--separate

Separate disconnected fragments into individual molecular records

-t

All input files describe a single molecule

--title title

Add or replace molecular title

-xoptions

Format-specific output options. See -H format-ID for options allowed by a particular format

-v SMARTS

Convert only molecules NOT matching SMARTS pattern specified

-V

Output version number and exit

-z

Compress the output with gzip

File Formats

The following formats are currently supported by Open Babel:

Format Options

Individual file formats may have additional formatting options.

Input format options are preceded by -a, e.g., -as

Output format options are preceded by -x, e.g., -xn

For further specific information and options, use -Hformat-type, e.g., -Hcml

Environment

OB_RANDOM_SEED

Seed for pseudo random number generator; random seed is used if unset or null. This feature is effective if Open Babel is built with -DOB_USE_OBRANDOMMT cpreprocessor flag (will be automatically enabled when version 4 is released).

Examples

Standard conversion:

obabel ethanol.xyz -Oethanol.pdb

Conversion from a SMI file in STDIN to a Mol2 file written to STDOUT:

obabel -ismi -omol2

Split a multi-molecule file into new1.smi, new2.smi, etc.:

obabel infile.mol -Onew.smi -m

See Also

obenergy(1), obfit(1), obgrep(1), obminimize(1), obprop(1), obrotamer(1), obrotate(1). The web pages for Open Babel can be found at: <http://openbabel.org/>

Authors

A cast of many, including the current maintainers Geoff Hutchison, Chris Morley, Michael Banck, and innumerable others who have contributed fixes and additions. For more contributors to Open Babel, see <https://openbabel.org/docs/Introduction/thanks.html>

Referenced By

obchiral(1), obconformer(1), obenergy(1), obfit(1), obgen(1), obgrep(1), obgui(1), obminimize(1), obprobe(1), obprop(1), obrotamer(1), obrotate(1), obspectrophore(1), obtautomer(1), obthermo(1), roundtrip(1).

May 26, 2026