The validity of your passport is very important when you travel. Not only in Japan, but also for the rest of the world. It is recommended to have a passport with at least 6 months of validity before going on a trip in most countries. Many airlines will even refuse to take you on board if your passport has less than 6 months of validity, even if you have already bought a plane ticket.
Although most embassies and consulates provide emergency passport services -at a higher cost- for foreigners who need a new passport immediately, it is always best to renew your passport at least 6 months before expiration, or more if you intend to leave Japan.
Tourists must have a valid passport for the entirety of their trip. They are also required by law to carry it at all times.
Short term residents (3 months or less)
Foreigners who have a short-term visa, that is a visa that is equal or shorter than 90 days, can not receive a residence card, and are therefor required to carry a valid passport at all times.
Mid- to long-term residents
Foreigners with a mid- to long-term visa will receive a residence card. If you have this card, you do not need to carry your passport with you, but you are required by law to carry your residence card on you at all times. Furthermore, as long as you don’t intend to leave Japan, having an expired passport as a non-temporary resident is not an issue. It is however recommended to have a valid passport in case you suddenly need to leave Japan.