Presently available techniques for predicting quantitative reservoir quality typically are limited in applicability to specific geographic areas or lithostratigraphic units, or require input data that are poorly constrained or difficult to obtain. We have developed a forward numerical model (Exemplar) of compaction and quartz cementation to provide a general method suited for porosity prediction of quartzose and ductile grain-rich sandstones in mature and frontier basins. The model provides accurate predictions for many quartz-rich sandstones using generally available geologic data as input. Model predictions can be directly compared to routinely available data, and can be used in risk analysis through incorporating parameter optimization and Monte Carlo techniques. The diagenetic history is modeled from the time of deposition to present. Compaction is modeled by an exponential decrease in intergranular volume as a function of effective stress. The model is consistent with compaction arising from grain rearrangement, ductile grain deformation, and brittle failure of grains, and accounts for the effects of fluid overpressures and stable grain packing configurations. Quartz cementation is modeled as a precipitation-rate-controlled process according to the method of Walderhaug (1994, 1996) and Walderhaug et al. (in press). Input data required for a simulation include effective stress and temperature histories, together with the composition and texture of the modeled sandstone upon deposition. Burial history data can be obtained from basin models, whereas sandstone composition and texture are derived from point-count analysis of analog thin sections. Exemplar predictions are consistent with measured porosity, intergranular volume, and quartz cement fractions for modeled examples from the Quaternary and Tertiary of the Gulf of Mexico Basin, the Jurassic of the Norwegian shelf, the Ordovician of the Illinois basin, and the Cambrian of the Baltic region.