The production cross sections of D0 and Λc+ hadrons originating from beauty-hadron decays (i.e., nonprompt) were measured for the first time at midrapidity (|y|<0.5) by the ALICE Collaboration in proton-proton collisions at a center-of-mass energy s=13 TeV. They are described within uncertainties by perturbative QCD calculations employing the fragmentation fractions of beauty quarks to baryons measured at forward rapidity by the LHCb Collaboration. The bb¯ production cross section per unit of rapidity at midrapidity, estimated from these measurements, is dσbb¯/dy||y|<0.5=83.1±3.5(stat)±5.4(syst)-3.2+12.3(extrap) μb. The baryon-to-meson ratios are computed to investigate the hadronization mechanism of beauty quarks. The nonprompt Λc+/D0 production ratio has a similar trend to the one measured for the promptly produced charmed particles and to the p/π+ and Λ/KS0 ratios, suggesting a similar baryon-formation mechanism among light, strange, charm, and beauty hadrons. The pT -integrated nonprompt Λc+/D0 ratio is found to be significantly higher than the one measured in e+e- collisions.