In this paper we study the accuracy of photometric redshifts computed through a standard SED fitting procedure, where SEDs are obtained from broad-band photometry. We present our public code hyperz, which is presently available on the web. We introduce the method and we discuss the expected influence of the different observational conditions and theoretical assumptions. In particular, the set of templates used in the minimization procedure (age, metallicity, reddening, absorption in the Lyman forest, ...) is studied in detail, through both real and simulated data. The expected accuracy of photometric redshifts, as well as the fraction of catastrophic identifications and wrong detections, is given as a function of the redshift range, the set of filters considered, and the photometric accuracy. Special attention is paid to the results expected from real data.