The nearest station is Leuchars (5 miles away) on the main line from London (King's Cross) - Edinburgh - Aberdeen. St Andrews may be reached by car, taxi or by service bus from Leuchars (2 to 3 buses per hour between 9am and 6pm and less frequently at other times).

From South cross Forth Road Bridge (toll is £1) and proceed north
along M90 to junction 2A. Follow the A92 until just before Cupar,
then join the A91 to St Andrews. Alternatively, take M90 to junction
8, then A91 to St Andrews.
From South-west either go east along M8 to Forth
Road Bridge and then by route above, or by Kincardine Bridge and
A977 towards Kinross, joining M90 at junction 6 and exiting at
junction 8, then by A91 to St Andrews.
From North-west leave Perth on M90 then by A913 to
Cupar and St Andrews.
From North via Dundee, cross Tay Road Bridge (toll is 80p) on A92
and after 1 mile via A919 to Leuchars and A91 to St Andrews.
The Gateway Building is number 12 on the university map, coordinates E2, it is on the A91 coming from Cupar and Leuchars.
If coming by car simply take a right at the first roundabout and the Gateway is the distinctive round building to your right. You can use its car park or the large free public car park (Petheram Bridge) opposite the building.
If coming by train, take a taxi or bus from the station at Leuchars. The taxi fare is approximately £8. The number
96,
96A,
94,
94A,
99,
99A,
99B and
23A buses go into St. Andrews and there is one roughly every twenty minutes. The single fare is £1.85.
If coming by bus, the bus station is just above the North Haugh. Walk downhill along the taxi rank and follow the path to the right alongside
Petheram Bridge car park. Take the first set of steps on your left, then walk across the car park. The round building almost opposite you is the Gateway.