A novel porphyrin-functionalized cotton fiber (CPT) for Cd2+ was prepared. The CPT exhibited color response and enhanced adsorption performance to Cd2+. A linear relationship used to determine the concentration of Cd2+ was established. The color of the CPT changed within 2 min in response to Cd2+.