We establish the following sharp local estimate for the family {R j } d j=1 of Riesz transforms on R d. For any Borel subset A of R d and any function f : R d → R, A |R j f (x)|dx ≤ Cp||f || L p (R d) |A| 1/q , 1 < p < ∞. Here q = p/(p − 1) is the harmonic conjugate to p, Cp = 2 q+2 Γ(q + 1) π q+1 ∞ k=0 (−1) k (2k + 1) q+1 1/q , 1 < p < 2, and Cp = 2 q+2 Γ(q + 1) π q ∞ k=0 1 (2k + 1) q 1/q , 2 ≤ p < ∞. This enables us to determine the precise values of the weak-type constants for Riesz transforms for 1 < p < ∞. The proof rests on appropriate martingale inequalities, which are of independent interest.