The longest subway system in the world is the Shanghai Metro in China, which has an operational length of 645 kilometers (401 miles).