We generalize recent results in two-dimensional Jackiw-Teitelboim gravity to study factorization of the Hilbert space of eternal black holes in quantum gravity with a negative cosmological constant in any dimension. We approach the problem by computing the trace of two-sided observables as a sum over a recently constructed family of semiclassically well-controlled black hole microstates. These microstates, which contain heavy matter shells behind the horizon and form an overcomplete basis of the Hilbert space, exist in any theory of gravity with general relativity as its low energy limit. Using this representation of the microstates, we show that the trace of operators dual to functions of the Hamiltonians of the left and right holographic CFTs factorizes into a product over left and right factors to leading order in the semiclassical limit. Under certain conditions this implies factorization of the Hilbert space.