We study the problem of determination of the sign of Delta m(31)(2), or the neutrino mass hierarchy, through observations of atmospheric neutrinos in future detectors. We consider two proposed detector types: (a) Megaton sized water Cerenkov detectors, which can measure the event rates of nu(mu)+(nu) over bar (mu) and nu(e)+(nu) over bar (e) and (b) 100 kton sized magnetized iron detectors, which can measure the event rates of nu(mu) and (nu) over bar (mu). For energies and path lengths relevant to atmospheric neutrinos, these rates obtain significant matter contributions from P(mu e), P(mu mu) and P(ee), leading to an appreciable sensitivity to the hierarchy. We do a binned chi(2) analysis of simulated data in these two types of detectors which includes the effect of smearing in neutrino energy and direction and incorporates detector efficiencies and relevant statistical, theoretical and systematic errors. We also marginalize the chi(2) over the allowed ranges of neutrino parameters in order to accurately account for their uncertainties. Finally, we compare the performance of both types of detectors vis a vis the hierarchy determination.