Catalyzes the last irreversible step in the biosynthesis of L-serine from carbohydrates, the dephosphorylation of O-phospho-L-serine to L-serine. L-serine can then be used in protein synthesis, to produce other amino acids, in nucleotide metabolism or in glutathione synthesis, or can be racemized to D-serine, a neuromodulator. May also act on O-phospho-D-serine. H2O + O-phospho-L-serine = L-serine + phosphate H2O + O-phospho-D-serine = D-serine + phosphate Binds 1 Mg(2+) ion per subunit. Amino-acid biosynthesis; L-serine biosynthesis; L-serine from 3-phospho-D-glycerate: step 3/3. Homodimer. Belongs to the HAD-like hydrolase superfamily. SerB family.