By train
The Pingxi Line is located to the east of Taipei, and can easily be done as a day trip from the capital. First you’ll need to get a train from Taipei Station to Ruifang Station (35-45 minutes on a limited express train, NT$76). Limited express trains are not that frequent, so try to book at least a day before. Local train services are also available for NT$49 and only take 10 to 20 minutes more.
From Ruifang Station, you can then join the Pingxi Line trains. Service is roughly hourly, but be sure to check the schedule when you are there, so you don’t miss the last train back. It’s recommended to get the Pingxi Line day pass, a convenient and cheap pass for the whole line.
By bus
If you would like to take a bus ride through the scenic valleys, you can alternatively take route 795 from Muzha Station on the Taipei Metro (about 1 hour, NT$45)