There are many ways to reach the Stanford University campus via public transportation.
The local transit hub is the Palo Alto Caltrain Station, located near the intersections of Palm Drive, University Avenue, and El Camino Real. The University’s free shuttle service, Marguerite, operates several routes between the train station and various campus locations. Lines O, N, and P are the ones that provide service later in the evening.
If you are interested in learning more, please visit Stanford's Bay Area Transit website.