The collinear and transverse-momentum-dependent jet fragmentation function and the radial profile for B± mesons in jets are measured. The B± mesons are reconstructed through the J/I¨(→I^¼+I^¼−)K± decay channel using proton-proton collision data collected during 2016-2018 with the LHCb detector at a center-of-mass energy of qrts=13 TeV, corresponding to an integrated luminosity of 5.4 fb−1. The results complement recent measurements of jet fragmentation functions for heavy-flavor hadrons and suggest a growing contribution of gluon fragmentation to B± mesons as the jet transverse momentum increases.