Most probably you will need a visa to enter Tanzania when you are travelling from Europe or the USA. Countries which are not required to apply for a visa can be found here.
Although it is possible to buy a tourist visa upon arrival at the airports of Dar es Salaam, Kilimanjaro and Zanzibar, we recommend that you apply for a visa in your home country prior to your trip. You can do this online at: Don't leave it last minute, latest two weeks before arrival in Tanzania so you are sure you give them enough time to process your online application. The application will take 20-40 minutes of your time and it will make it easier if you have the below documents ready: