We present 1D radiative transfer modelling of the envelopes of a sample of 18 low-mass protostars and pre-stellar cores with the aim of setting up realistic physical models, for use in a chemical description of the sources. The density and temperature profiles of the envelopes are constrained from their radial profiles obtained from SCUBA maps at 450 and 850 micron and from measurements of the source fluxes ranging from 60 micron to 1.3 mm. The densities of the envelopes within ~10000 AU can be described by single power-laws r^{-p} for the class 0 and I sources with p ranging from 1.3 to 1.9, with typical uncertainties of +/- 0.2. Four sources have flatter profiles, either due to asymmetries or to the presence of an outer constant density region. No significant difference is found between class 0 and I sources. The power-law fits fail for the pre-stellar cores, supporting recent results that such cores do not have a central source of heating. The derived physical models are used as input for Monte Carlo modelling of submillimeter C18O and C17O emission. It is found that class I objects typically show CO abundances close to those found in local molecular clouds, but that class 0 sources and pre-stellar cores show lower abundances by almost an order of magnitude implying that significant depletion occurs for the early phases of star formation. While the 2-1 and 3-2 isotopic lines can be fitted using a constant fractional CO abundance throughout the envelope, the 1-0 lines are significantly underestimated, possibly due to contribution of ambient molecular cloud material to the observed emission. The difference between the class 0 and I objects may be related to the properties of the CO ices.