We investigate how the typical dust extinction of H \alpha luminosity from a star-forming galaxy depends upon star formation rate ( SFR ) , metallicity and stellar mass independently , using a sample of \sim 90,000 galaxies from Data Release 7 of the Sloan Digital Sky Survey ( SDSS ) . We measure extinctions directly from the Balmer decrement of each source , and while higher values of extinction are associated with an increase in any of the three parameters , we demonstrate that the fundamental property that governs extinction is stellar mass . After this mass-dependent relationship is removed , there is very little systematic dependence of the residual extinctions with either SFR or metallicity , and no significant improvement is obtained from a more general parameterisation . In contrast to this , if either a SFR-dependent or metallicity-dependent extinction relationship is applied , the residual extinctions show significant trends that correlate with the other parameters . Using the SDSS data , we present a relationship to predict the median dust extinction of a sample of galaxies from its stellar mass , which has a scatter of \sim 0.3 mag . The relationship was calibrated for H \alpha emission , but can be more generally applied to radiation emitted at other wavelengths . These results have important applications for studies of high-redshift galaxies , where individual extinction measurements are hard to obtain but stellar mass estimates can be relatively easily estimated from long-wavelength data .