  The computation of complex neutral/ionised chemical equilibrium compositions
is invaluable to obtain scientific insights of, for example, the atmospheres of
extrasolar planets and cool stars. We present FastChem 2, a new version of the
established semi-analytical thermochemical equilibrium code FastChem. Whereas
the original version is limited to atmospheres containing a significant amount
of hydrogen, FastChem 2 is also applicable to chemical mixtures dominated by
any other species, such as CO$_2$ or N$_2$. The new C++ code and an optional
Python module are publicly available under the GPLv3 license at
https://github.com/exoclime/FastChem. The program is backward compatible so
that the previous version can be easily substituted. We updated the
thermochemical database by adding HNC, FeH, TiH, Ca$^-$, and some organic
molecules. In total 523 species are now in the thermochemical database
including 28 chemical elements. The user can reduce the total number of species
to, for example, increase the computation performance or can add further
species if the thermochemical data are available. The program is validated
against its previous version and extensively tested over an extended
pressure-temperature grid with pressures ranging from $10^{-13}\,\mathrm{bar}$
up to $10^3\,\mathrm{bar}$ and temperatures between $100\,\mathrm{K}$ and
$6000\,\mathrm{K}$. FastChem 2 is successfully applied to a number of different
scenarios including nitrogen, carbon, and oxygen-dominated atmospheres as well
as test cases without hydrogen and helium. Averaged over the extended
pressure-temperature grid FastChem 2 is up to 50 times faster than the previous
version and is also applicable to situations not treatable with version 1.
