The injured, 13 male and 12 female, were rushed to six hospitals for treatment. Two of them were in serious condition.
The blast happened in the sixth car of commuter train number 1258 between Hsinchu and Keelung, when it was reaching Songshan Railway Station at about 22:00 Thursday.
A fire broke out after the blast. Firefighters put it out within several minutes.
Police found a broken steel tube at the scene, which was suspected to be the explosive device.
The cause of the accident is being investigated. Security measures have tightened at train and subway stations in the island of Taiwan.
S/SH 11