We present a theoretical model for the nucleation of amyloid fibrils. In our model, we use helix-coil theory to describe the equilibrium between a soluble native state and an aggregation-prone unfolded state. We then extend the theory to include oligomers with beta-sheet cores, and calculate the free energy of these states using estimates for the energies of H-bonds, steric-zipper interactions, and the conformational entropy cost of forming secondary structure. We find that states with fewer than similar to 10 beta-strands are unstable, relative to the dissociated state, and three beta-strands is the highest free-energy state. We then use a modified version of classical nucleation theory to compute the nucleation rate of fibrils from a supersaturated solution of monomers, dimers, and trimers. The nucleation rate has a nonmonotonic dependence on denaturant concentration, reflecting the competing effects of destabilizing the fibril and increasing the concentration of unfolded monomers. We estimate heterogeneous nucleation rates, and discuss the application of our model to secondary nucleation.