We describe how Mirković–Vilonen (MV) polytopes arise naturally from the categorification of Lie algebras using Khovanov–Lauda–Rouquier (KLR) algebras. This gives an explicit description of the unique crystal isomorphism between simple representations of KLR algebras and MV polytopes. MV polytopes, as defined from the geometry of the affine Grassmannian, only make sense in finite type. Our construction on the other hand gives a map from the infinity crystal to polytopes for all symmetrizable Kac–Moody algebras. However, to make the map injective and have well-defined crystal operators on the image, we must in general decorate the polytopes with some extra information. We suggest that the resulting ‘KLR polytopes’ are the general-type analogues of MV polytopes. We give a combinatorial description of the resulting decorated polytopes in all affine cases, and show that this recovers the affine MV polytopes recently defined by Baumann, Kamnitzer, and the first author in symmetric affine types. We also briefly discuss the situation beyond affine type.