Interaction cross sections and charged pion spectra in p+C interactions at 31 GeV/c were measured with the large acceptance NA61/SHINE spectrometer at the CERN SPS. These data are required to improve predictions of the neutrino flux for the T2K long baseline neutrino oscillation experiment in Japan. A set of data collected during the first NA61/SHINE run in 2007 with an isotropic graphite target with a thickness of 4% of a nuclear interaction length was used for the analysis. The measured p+C inelastic and production cross sections are 257.2 +- 1.9 +- 8.9 mb and 229.3 +- 1.9 +- 9.0 mb, respectively. Inclusive production cross sections for negatively and positively charged pions are presented as a function of laboratory momentum in 10 intervals of the laboratory polar angle covering the range from 0 up to 420 mrad. The spectra are compared with predictions of several hadron production models.