Most trains do not operate 24 hours; for example, in Tokyo they do not run in the early morning 01:00-05:00, and the Shinkansen never runs overnight. If you are planning to be out late and are relying on the train to get home, be sure to find out when the last train is leaving.