Program FOX for ab initio crystal structure determination from powder diffraction uses global optimization algorithms to find the correct structure by making trials in the direct space. It is a modular program, capable of using several criteria for evaluating each trial configuration, e.g. combining neutron and X-ray diffraction patterns. The program describes the structural building blocks (polyhedrons, molecules etc.) with their internal coordinates (Z-matrices), thus allowing natural constraints on interatomic distances and angles. Identical atoms shared between neighboring building blocks, and special positions are handled with an automatic, adaptive method (Dynamical Occupancy Correction). Several algorithms (Simulated Annealing, Parallel Tempering) are currently available. The program is based on an object-oriented crystallographic library ObjCryst++(programming language c++). The program and the library are available for Linux and Windows on http://objcryst.sourceforge.net. Inorganic and organic structures with the complexity up to 26 independents atoms are routinely solved from laboratory X-ray, synchrotron or neutron data.