The invention provides phenolphthalein type copolyimide. According to the phenolphthalein type copolyimide, a side-hanging phenolphthalein constructional unit and a side-hanging ether bond flexible unit are introduced into a rigid main chain of polyimide, and the phenolphthalein type copolyimide has the characteristics of good solubility, good processibility, good mechanical property, good heat resistance and the like, is suitable for injection molding, extrusion, mold pressing and solution spinning processing, and has a good application prospect in related fields of high-temperature-resistant engineering plastics, films, fibers, adhesives, coatings, advanced composite materials and the like. Besides, the phenolphthalein type copolyimide is prepared from raw materials including phenolphthalein monomer I, double-X-replaced polyimide monomer II and double-Y-replaced monomer III, and the phenolphthalein type copolyimide is prepared by virtue of an aromatic nucleophilic substitution reaction; the preparation method is low in cost, the polymer is excellent in performance and can be adjusted and controlled by virtue of a copolymerization unit, the defect that a dianhydride and diamine method adopted to prepare polyimide has a complex synthetic route is overcome, and the production cost of polyimide can be greatly reduced.