We develop a simple dynamic economic model of epidemic transmission designed to be consistent with widely used SIR biological models of the transmission of epidemics, while incorporating economic benefits and costs as well. Our main finding is that targeted testing and isolation policies deliver large welfare gains relative to optimal policies when these tools are not used. Specifically, we find that when testing and isolation are not used, optimal policy delivers a welfare gain equivalent to a 0.6% permanent increase in consumption relative to no intervention. The welfare gain arises because under the optimal policy, the planner engineers a sharp recession that reduces aggregate output by about 40% for about 3 months. This sharp contraction in economic activity reduces the rate of transmission and reduces cumulative deaths by about 0.1%. When testing policies are used, optimal policy delivers a welfare gain equivalent to a 3% permanent increase in consumption. The associated recession is milder in that aggregate output declines by about 15% and cumulative deaths are reduced by .3%. Much of this welfare gain comes from isolating infected individuals. When individuals who are suspected to be infected are isolated without any testing, optimal policy delivers a welfare gain equivalent to a 2% increase in permanent consumption.