We introduce the notion of the Bernstein–Sato polynomial of an arbitrary variety (which is not necessarily reduced nor irreducible) using the theory of V-filtrations of M. Kashiwara and B. Malgrange. We prove that the decreasing filtration by multiplier ideals coincides essentially with the restriction of the V-filtration. This implies a relation between the roots of the Bernstein–Sato polynomial and the jumping coefficients of the multiplier ideals, and also a criterion for rational singularities in terms of the maximal root of the polynomial in the case of a reduced complete intersection. These are generalizations of the hypersurface case. We can calculate the polynomials explicitly in the case of monomial ideals.