Many libraries and archives around the world, both brick-and-mortar and online, house collections useful for genealogy. In the United States, these varied repositories include, but are not limited to, the following.
Allen County Public Library Genealogy Center (Fort Wayne, Indiana)
http://www.genealogycenter.org/
Clayton Library Center for Genealogical Research (Houston, Texas)
http://www2.houstonlibrary.org/clayton/
Denver Public Library (Denver, Colorado)
https://history.denverlibrary.org/genealogy
Digital Public Library of America
https://dp.la/
Family History Library (Salt Lake City, Utah)
https://familysearch.org/locations/saltlakecity-library
Google Books
https://books.google.com/
Hathi Trust Digital Library
https://www.hathitrust.org/digital_library
Internet Archive
https://archive.org/index.php
Library of Congress (Washington, DC)
https://www.loc.gov/
Mid-Continent Public Library Midwest Genealogy Center (Independence, Missouri)
http://www.mymcpl.org/genealogy
National Archives and Records Administration (Washington, DC, and regional branches)
https://www.archives.gov/
National Society Daughters of the American Revolution Library (Washington, DC)
http://www.dar.org/library
Newberry Library, Genealogy and Local History (Chicago, Illinois)
https://www.newberry.org/genealogy-and-local-history
New England Historic Genealogical Society Research Library (Boston, Massachusetts)
https://www.americanancestors.org/education/learning-resources/read/using-the-nehgs-library
New York Public Library, Research (New York City, New York)
https://www.nypl.org/about/divisions/milstein
St. Louis County Library, History & Genealogy (St. Louis, Missouri)
https://www.slcl.org/genealogy
Library of Virginia (Richmond, Virginia)
http://www.lva.virginia.gov/
Wisconsin Historical Society Library
https://www.wisconsinhistory.org