Patent classification systems are largely designed for administrative purposes, limiting their value for most research purposes. To address this deficiency, Hall, Jaffe, and Trajtenberg (2001) developed a higher-level classification for the National Bureau of Economic Research (NBER) Patent Citation Data File by aggregating U.S. Patent Classification (USPC) classes into six economically relevant technology categories (and 37 sub-categories) and classified granted patents accordingly. While this classification scheme has proved useful for researchers investigating US patent grants, comparable information on pending or abandoned patent applications has been unavailable for several reasons. We apply the NBER sub-categories to published and publicly-available unpublished patent applications as well as in-force and expired patents to create the USPTO Historical Patent Data Files, four research datasets containing time series and micro-level data by NBER sub-category. These new datasets comprise annual information on patent applications, patent grants, and patents-in-force dating back to 1840. Additionally, we provide information on the monthly stocks and flows of utility patent applications and grants from 1981 to 2014. Our hope is that researchers will make use of the data files for primary analysis or as controls for other projects. These data, for the first time, provide for detailed study of patent application disposal and the complex dynamics between new filings, pendency, and abandonment. Historical data enable researchers to put into context recent trends in patenting activity, litigation, and technological change.