In asteroseismology, the surface effect is a disparity between the observed and the modelled oscillation frequencies. It originates from improper modelling of the surface layers in stars with solar-like oscillations. Correcting the surface effect usually requires using functions with free parameters, which are conventionally fitted to the observed frequencies. On the basis that the correction should vary smoothly across the H-R diagram, we parameterize it as a simple function of three stellar surface properties: surface gravity, effective temperature, and metallicity. We determine this function by fitting stars ranging from main-sequence dwarfs to red-giant-branch stars. The absolute amount of the surface correction increases with surface gravity, but the ratio between it and ν max decreases. Applying the prescription has an advantage of eliminating unrealistic surface correction, which improves parameter estimations with stellar modelling. Using two open clusters, we found that adopting the prescription can help reduce the scatter of the modelderived ages for each star in the same cluster. For an application, we provide a new revision for the ∆ν scaling relation, using our prescription to account for the surface effect in models. The values of the correction factor, f ∆ν , are up to 2% smaller than those determined without the surface effect considered, suggesting decreases of up to 4% in asteroseismic scaling radii and up to 8% in asteroseismic scaling masses. This revision brings the asteroseismic properties into agreement with those determined from eclipsing binaries. Finally, the new correction factor and the stellar models with the corrected frequencies are made publicly available.