In a sampling problem, we are given an input x ∈ {0, 1} n , and asked to sample approximately from a probability distribution D x over poly (n)-bit strings. In a search problem, we are given an input x ∈ {0, 1} n , and asked to find a member of a nonempty set A x with high probability. (An example is finding a Nash equilibrium.) In this paper, we use tools from Kolmogorov complexity to show that sampling and search problems are "essentially equivalent." More precisely, for any sampling problem S, there exists a search problem R S such that, if C is any "reasonable" complexity class, then R S is in the search version of C if and only if S is in the sampling version. What makes this nontrivial is that the same R S works for every C.As an application, we prove the surprising result that SampP = SampBQP if and only if FBPP = FBQP. In other words, classical computers can efficiently sample the output distribution of every quantum circuit, if and only if they can efficiently solve every search problem that quantum computers can solve.