No, 40 gallons is not enough for 2 goldfish. In fact, a single goldfish needs at least 10 gallons, so you would need a minimum of 20 gallons to keep 2 goldfish happy and healthy. However, we recommend getting a larger tank if possible because goldfish are messy eaters and produce a lot of waste.