Upvote:0
You get it on Arrival, however it's only issued if there are no connecting flights to your destination on the same calendar day. It's valid for 72 hours.
At Immigration, Show your onward ticket and passport
Upvote:1
As India is not on Japan's Visa Waiver List you should be able to get a Shore Pass/Transit Pass however this is not guaranteed (as we don't know your particular circumstances) and you may be refused boarding by the airline in some cases.
Japan has the following (taken from Qatar Airways Visa Check Portal)
TWOV (Transit Without Visa):
Somewhat confusingly, the Japanese Embassy in India website mentions that you will need to apply for a transit visa in advance. Failure to have a valid transit visa (as your trip is 21 hours long and Narita Airport does close), you may be denied boarding as has happened to some people.
You should check with the Japanese Embassy closest to you as your personal circumstances determine your validity for the transit visa and there is not a guarantee of you receiving a transit visa in all cases.