Let
R
R
be a standard graded algebra over a field. We investigate how the singularities of
Spec
R
\operatorname {Spec} R
or
Proj
R
\operatorname {Proj} R
affect the
h
h
-vector of
R
R
, which is the coefficient of the numerator of its Hilbert series. The most concrete consequence of our work asserts that if
R
R
satisfies Serre’s condition
(
S
r
)
(S_r)
and has reasonable singularities (Du Bois on the punctured spectrum or
F
F
-pure), then
h
0
h_0
, …,
h
r
≥
0
h_r\geq 0
. Furthermore the multiplicity of
R
R
is at least
h
0
+
h
1
+
⋯
+
h
r
−
1
h_0+h_1+\dots +h_{r-1}
. We also prove that equality in many cases forces
R
R
to be Cohen-Macaulay. The main technical tools are sharp bounds on regularity of certain
Ext
\operatorname {Ext}
modules, which can be viewed as Kodaira-type vanishing statements for Du Bois and
F
F
-pure singularities. Many corollaries are deduced, for instance that nice singularities of small codimension must be Cohen-Macaulay. Our results build on and extend previous work by de Fernex-Ein, Eisenbud-Goto, Huneke-Smith, Murai-Terai and others.