Heavy quark fragmenting jet functions describe the fragmentation of a parton into a jet containing a heavy quark, carrying a fraction of the jet momentum. They are twoscale objects, sensitive to the heavy quark mass, m Q , and to a jet resolution variable, τ N . We discuss how cross sections for heavy flavor production at high transverse momentum can be expressed in terms of heavy quark fragmenting jet functions, and how the properties of these functions can be used to achieve a simultaneous resummation of logarithms of the jet resolution variable, and logarithms of the quark mass. We calculate the heavy quark fragmenting jet function G Q Q at O(α s ), and the gluon and light quark fragmenting jet functions into a heavy quark, G Q g and G Q l , at O(α 2 s ). We verify that, in the limit in which the jet invariant mass is much larger than m Q , the logarithmic dependence of the fragmenting jet functions on the quark mass is reproduced by the heavy quark fragmentation functions. The fragmenting jet functions can thus be written as convolutions of the fragmentation functions with the matching coefficients J ij , which depend only on dynamics at the jet scale. We reproduce the known matching coefficients J ij at O(α s ), and we obtain the expressions of the coefficients J gQ and J lQ at O(α 2 s ). Our calculation provides all the perturbative ingredients for the simultaneous resummation of logarithms of m Q and τ N .