Hierarchical mergers are one of the distinctive signatures of binary black hole ( BBH ) formation through dynamical evolution . Here , we present a fast Monte Carlo approach to simulate hierarchical mergers in nuclear star clusters ( NSCs ) , globular clusters ( GCs ) and young star clusters ( YSCs ) . Hierarchical mergers are orders of magnitude more common in NSCs than they are in both GCs and YSCs , because of the different escape velocity . In our fiducial model , the fraction of hierarchical mergers over all mergers is \sim { } 0.15 , \sim { } 6 \times { } 10 ^ { -3 } and \sim { } 10 ^ { -4 } in NSCs , GCs and YSCs , respectively . The mass distribution of hierarchical BBHs strongly depends on the properties of first-generation BBHs , such as their progenitor ’ s metallicity . In our fiducial model , we form black holes ( BHs ) with masses up to \sim { } 10 ^ { 3 } M _ { \odot } in NSCs and up to \sim { } 10 ^ { 2 } M _ { \odot } in both GCs and YSCs . When escape velocities in excess of 100 km s ^ { -1 } are considered , BHs with mass > 10 ^ { 3 } M _ { \odot } are allowed to form in NSCs . Hierarchical mergers lead to the formation of BHs in the pair instability mass gap and intermediate-mass BHs ( IMBHs ) , but only in metal-poor environments . In our fiducial model , at metallicity Z \sim { } 0.0002 , the fraction of BBH mergers with primary BH in the pair instability mass gap is \sim { } 7 \times { } 10 ^ { -3 } , 3 \times { } 10 ^ { -4 } and 5 \times { } 10 ^ { -6 } in NSCs , GCs and YSCs , respectively . In metal-poor NSCs , the fraction of BBH mergers with primary mass in the IMBH regime is \sim { } 5 \times { } 10 ^ { -4 } . The local BBH merger rate in our models ranges from \sim { } 10 to \sim { } 60 Gpc ^ { -3 } yr ^ { -1 } ; hierarchical BBHs in NSCs account for \sim { } 10 ^ { -2 } -0.2 Gpc ^ { -3 } yr ^ { -1 } , with a strong upper limit of \sim { } 10 Gpc ^ { -3 } yr ^ { -1 } .