We prove that a function f is in the Sobolev class W loc (ℝ n ) or W m,p (Q) for some cube Q ⊂ ℝ n if and only if the formal (m − 1)-Taylor remainder R m−1 f(x,y) of f satisfies the pointwise inequality |R m−1 f(x,y)| ≤ |x − y| m [a(x) + a(y)] for some a e L p (Q) outside a set N ⊂ Q of null Lebesgue measure. This is analogous to H. Whitney’s Taylor remainder condition characterizing the traces of smooth functions on closed subsets of ℝ n .