This depends on the type of coffee and whether it is open or closed.

Roasted ground coffee can be kept for three to five months.

Whole bean coffee can be kept for six to nine months.

After opening the package, the coffee will last less time.

Opened coffee powder can be kept for three months.

After the first use, whole bean coffee can be kept well closed for six months.

Keeping the bag closed will allow the coffee to be used for a longer period of time.