New NMR broadband inversion pulses that compensate both for resonance offset and radiofrequency (RF) inhomogeneity are described. The approach described is a straightforward computer optimization of an initial digitized waveform generated from either a constant-amplitude frequency sweep or from an existing composite inversion pulse. Problems with convergence to local minima are alleviated by the way the optimization is carried out. For a given duration and maximum allowable RF field strength B1 (but not necessarily given RMS power deposition), the resultant broadband inversion pulse (BIP) shows superior inversion compared to inversion pulses obtained from previous methods, including adiabatic inversion pulses. Any existing BIP can be systematically elaborated to build up longer inversion pulses that perform over larger and larger bandwidths. The resulting pulse need not be adiabatic throughout its duration or across the entire operational bandwidth.