The Division of HIV/AIDS Prevention (DHAP) at the Centers for Disease Control and Prevention has an annual budget of approximately $325 million for funding HIV prevention programs in the U.S. The purpose of this paper is to thoroughly describe the methods used to develop a national HIV resource allocation model intended to inform DHAP on allocation strategies that might improve the overall effectiveness of HIV prevention efforts. The HIV prevention resource allocation problem consists of choosing how to apportion prevention resources among interventions and populations so that HIV incidence is minimized, given a budget constraint. We developed an epidemic model that projects HIV infections over time given a specific allocation scenario. The epidemic model is then embedded in a nonlinear mathematical optimization program to determine the allocation scenario that minimizes HIV incidence over a 5-year horizon. In our model, we consider the general U.S. population and specific at-risk populations. The at-risk populations include 15 subgroups structured by gender, race/ethnicity and HIV transmission risk group. HIV transmission risk groups include high-risk heterosexuals, men who have sex with men and injection drug users. We consider HIV screening interventions and interventions to reduce HIV-related risk behaviors. The output of the model is the optimal funding scenario indicating the amounts to be allocated to all combinations of populations and interventions. For illustrative purposes only, we provide a sample application of the model. In this example, the optimal allocation scenario is compared to the current baseline funding scenario to highlight how the current allocation of funds could be improved. In the baseline allocation, 29% of the annual budget is aimed at the general population, while the model recommends targeting 100% of the budget to the at-risk populations with no allocation targeted to the general population. Within the allocation to behavioral interventions the model recommends an increase in targeting diagnosed positives. Also, the model allocation suggests a greater focus on MSM and IDUs with a 72% of the annual budget allocated to them, while the baseline allocation for MSM and IDUs totals 37%. Incorporating future epidemic trends in the decision-making process informs the selection of populations and interventions that should be targeted. Improving the use of funds by targeting the interventions and population subgroups at greatest risk may lead to improved HIV outcomes. These models can also direct research by pointing to areas where the development of cost-effective interventions can have the most impact on the epidemic.