  Fragmentation functions and their uncertainties are determined for pion,
kaon, and proton by a global $\chi^2$ analysis of charged-hadron production
data in electron-positron annihilation and by the Hessian method for error
estimation. It is especially important that the uncertainties of the
fragmentation functions are estimated in this analysis. The results indicate
that the fragmentation functions, especially gluon and light-quark
fragmentation functions, have large uncertainties at small $Q^2$. There are
large differences between widely-used functions by KKP (Kniehl, Kramer, and
P\"otter) and Kretzer; however, they are compatible with each other and also
with our functions if the uncertainties are taken into account. We find that
determination of the fragmentation functions is improved in
next-to-leading-order (NLO) analyses for the pion and kaon in comparison with
leading-order ones. Such a NLO improvement is not obvious in the proton. Since
the uncertainties are large at small $Q^2$, the uncertainty estimation is very
important for analyzing hadron-production data at small $Q^2$ or $p_T$ ($Q^2,
p_T^2 << M_Z^2$) in lepton scattering and hadron-hadron collisions. A code is
available for general users for calculating obtained fragmentation functions.
