XSTAR is a command-driven, interactive, computer program for calculating the physical conditions and emission spectra of photoionized gases. It may be applied in a wide variety of astrophysical contexts. Stripped to essentials, its job may be described simply: A spherical gas shell surrounding a central source of ionizing radiation absorbs some of this radiation and reradiates it in other portions of the spectrum; XSTAR computes the effects on the gas of absorbing this energy, and the spectrum of reradiated light. The user supplies the shape and strength of the incident continuum, the elemental abundances in the gas, its density or pressure, and its thickness; the code can be directed to return any of a large number of derived quantities, including (but not limited to) the ionization balance and temperature, opacity tables, and emitted line and continuum fluxes.