The exact solution of the one-dimensional Hubbard model, both attractive and repulsive, is investigated numerically over a wide range of interaction strength U/t (−∞<U/t<∞), electron concentration n (0⩽n⩽1) and magnetic field h. The magnetic phase diagram and the ground-state properties, including the total energy, the average spin (magnetization) and the spin (magnetic) susceptibility are studied under the variation of U/t, h/t and n. The critical behavior near the onset of magnetization and magnetic saturation is analyzed. Our results are in full agreement with the analytical expansions in strong and weak interaction limits and previous numerical studies for h=0.