The Library of Congress has online digital images of white and yellow pages telephone directories for many states, from 1900 through 1999. These searchable directories are in the U.S. Telephone Directory Collection. There are 3,513 images online. Other collections of city directories are online at Hathi Trust Digital Library. Enter the search phrase “city directory” and select Title in the drop down menu and the Full-text radial button. Further refinement is available by year and state. If the directories aren’t digitized, select the Find In A Library option. Most of these records are catalog listings, only. The full directory is keyword searchable.
Check the state,city, county, university, local library, and genealogy society for free online collections. These are often identified as “digital archive” or “digital collections.” The City of San Diego has downloadable city directories through 1960 in PDF format. Additional searchable city directories are available at the Internet Archive. Keyword search across the FamilySearch database, “United States City and Business Directories, ca. 1749 – ca. 1990.”