A nonparametric smooth line is usually added to the spectral model to account for background signals in vivo magnetic resonance spectroscopy (MRS). The assumed smoothness of the baseline significantly influences quantitative spectral fitting. In this paper, a method is proposed to minimize baseline influences on the estimated spectral parameters. The nonparametric baseline function with a given smoothness was treated as a function of spectral parameters. Its uncertainty was measured by root-mean-square error (RMSE). The proposed method was demonstrated with a simulated spectrum and in vivo spectra of both short echo time and averaged echo times. The estimated in vivo baselines were compared with the metabolite-nulled spectra and the LCModel-estimated baselines. The accuracies of estimated baseline and metabolite concentrations were further verified via cross-validation. An optimal smoothness condition was found that led to the minimal baseline RMSE. In this condition, the best fit was balanced against minimal baseline influences on metabolite concentration estimates. Baseline RMSE can be used to indicate estimated baseline uncertainties and serve as the criterion for determining the baseline smoothness of in vivo MRS.