When visiting a temple or shrine, you may notice a wooden box in front of the main hall. This is an offertory box, a box in which you can drop an offering to the deities of that temple or shrine. These offerings nowadays are Japanese coins, and they are referred to as saisen.
Originally, people would offer rice to the deities. This would come in two forms: either sanmai, which was scattering rice before the kami (deity), or ohineri, which was a small amount of rice packaged in twisted paper. Eventually, this tradition was replaced with coins as the use of currency spread across the nation.
The offering of saisen is usually done by people on irregular visits when they have come to ask something of the kami. The offering is given as a request for the kami to listen to their prayers and answer their wishes. Because this is a showing of gratitude to the kami, it is up to the visitor’s digression to decide how much they want to offer. It is most common to throw coins rather than bills.
The offertory boxes are designed with wooden or metal bars across the top or with two slopes toward the center in an effort to prevent people reaching into the box. The offerings help the shrines and temples greatly with affording maintenance, especially the offerings made on New Years because they are usually considerable sums.
When you visit a temple or shrine, it would definitely be appreciated if you offer saisen to the kami or deity. While this is not required, it shows respect to the shrine or temple as well as the deities that are enshrined there. Do not worry about the amount you give, but rather the fact that you are respecting the traditions.