The ray-tracing code Zgoubi computes particle trajectories in arbitrary magnetic and/or electric field maps or analytical models. The code is a genuine compendium of numerical recipes for simulation of most types of optical elements encountered in beam optics. It contains a built-in fit procedure, synchrotron radiation calculation, spin tracking, many Monte Carlo processes, etc. The high accuracy of the integration method allows efficient multiturn tracking in periodic machines. (C) 1999 Published by Elsevier Science B.V. All rights reserved.