Amphiphilic random copolymers bearing hydrophilic poly(ethylene glycol) (PEG) and hydrophobic alkyl pendants showed dynamic self-sorting behavior, that is, self-recognition, under competitive conditions in aqueous media. The self-sorting universally takes place not only in water but also in hydrogels and on the material surfaces, according to encoded information originating from the primary structure of composition and pendants. Binary blends of the copolymers with different composition or alkyl pendants readily induced composition- or alkyl pendant-dependent self-sorting to simultaneously provide discrete and size-controlled micelles with hydrophobic cores. Surprisingly, the micelles reversibly keep exchanging polymer chains exclusively between identical polymer micelles even in the presence of different counterparts. Owing to the dynamic self-sorting behavior, ABA-triblock copolymers comprising the amphiphilic random copolymer A segments and a hydrophilic PEG chain B segment further provided hydrogels with self-healing yet selectively adhesive properties.