In order to obtain the characteristics of the deflagration‐to‐detonation transition (DDT) of PBX‐2 (an HMX‐based explosive) under different conditions, DDT tests were carried out as a function of charge density, temperature, and shell confinement. In these tests, the energetic materials were electrically ignited. The DDT response characteristics for PBX‐2 with 53 % and 99 % of theoretical maximum density (TMD) were evaluated by different shell thickness confinements at ambient temperature and at 85 °C. The test results with different densities, confinements and temperatures exhibited a wide range of reaction violence. Firstly, at both ambient temperature and at 85 °C under 10 and 20 mm shell thickness confinement, PBX‐2 did not undergo fully DDT at 99 % TMD, only a low velocity detonation (LVD) occurred. Secondly, PBX‐2 at 53 % TMD underwent DDT, and significant influence on the minimum run distance to detonation by the shell confinement thickness was observed. Strong confinement is favorable for the transition of DDT but the confinement does not influence reaction degree. Thirdly, the reaction degree of PBX‐2 at 85 °C was remarkably lower than that at ambient temperature. This insensitizing effect of temperature is induced by the melting and flowing of bonders which reduces the porosity and inhibits an important step of DDT, namely, high turbulent combustion.