Among the spectroscopically identified white dwarfs, a fraction smaller than 2% have spectra dominated by carbon lines, mainly molecular C_2_, but also in a smaller group by CI and CII lines. These are together called DQ white dwarfs. We derive atmospheric parameters Teff, logg, and carbon abundances for a large sample of these stars and discuss implications for their spectral evolution. Sloan Digital Sky Survey spectra and ugriz photometry were used, together with Gaia Data Release 2 parallaxes and G band photometry. These were fitted to synthetic spectra and theoretical photometry derived from model atmospheres. We found that the DQs hotter than Teff ~10000K have masses ~0.4M_{sun}_ larger than the classical DQ, which have masses typical for the majority of white dwarfs (~0.6M_{sun}_). We found some evidence that the peculiar DQ below 10000K also have significantly larger masses and may thus be the descendants of the hot and warm DQs above 10000K. A significant fraction of the hotter objects with Teff>14500K have atmospheres dominated by carbon.