We present a comparative, combined ab initio and experimental study of sodium and lithium storage in amorphous (glassy) carbon (a-C) versus graphite. Amorphous structures are obtained by fitting stochastically generated structures to a reference radial distribution function. Li insertion is thermodynamically favored in both graphite and a-C. While sodium insertion is thermodynamically unfavored in graphite, a-C possesses multiple insertion sites with binding energies stronger than Na cohesive energy, making it usable as anode material for Na-ion batteries. Binding energy of Na is predicted to be stronger than the Na cohesive energy for Na concentrations corresponding to a capacity of about 200 mAh/g. These results are confirmed by experimental measurements using highly amorphous carbon, in which a specific capacity of 173 mAh/g for Na is obtained after 100 cycles.