Perceptual biases are widely regarded as a window into the computational principles underlying human perception. To understand these biases, previous work has proposed a number of conceptually different and even seemingly contradicting ingredients, including attraction to a Bayesian prior, repulsion from the prior due to efficient coding, and central tendency effects on a bounded range. We present a unifying Bayesian theory of biases in perceptual estimation. We theoretically demonstrate an additive decomposition of perceptual biases into attraction to a prior, repulsion away from regions with high encoding precision, and regression away from the boundary. The results reveal a simple and universal rule for predicting the direction of perceptual biases. Our theory accounts for, and leads to new understandings of biases in the perception of a variety of stimulus attributes, including orientation, color, and magnitude.