Let X be a semistable curve and L a line bundle whose multidegree is uniform, i.e., in the range between those of the structure sheaf and the dualizing sheaf of X. We establish an upper bound for $$h^0(X,L)$$
h
0
(
X
,
L
)
, which generalizes the classic Clifford inequality for smooth curves. The bound depends on the total degree of L and connectivity properties of the dual graph of X. It is sharp, in the sense that on any semistable curve there exist line bundles with uniform multidegree that achieve the bound.