Self-sorting, in which multiple components selectively assemble themselves by recognising self from others, is an attractive approach to produce supramolecular assemblies with controlled structures. Lock-and-key type complementary physical interactions are required for self-sorting because selective affinity is necessary to distinguish self from others. Here we show self-sorting behaviour based on a principle of geometrical complementarity by shape during our investigation of assembly of pentagonal pillar[5]arenes and hexagonal pillar[6]arenes on a surface. In the homoassembly systems, anionic pillar[5]arenes and pillar[6]arenes are adsorbed onto positively charged layers of cationic pillar[5]arenes and pillar[6]arenes, respectively, through cationic-anionic electrostatic interactions. In contrast, ionic pillar[5]arenes are adsorbed onto layers constructed from oppositely charged pillar[5]arenes, but ionic pillar[6]arenes are not. Equally, for the reverse combination, ionic pillar[6]arenes are adsorbed onto layers constructed from oppositely charged pillar[6]arenes, but ionic pillar[5]arenes are not. The geometrical complementarity by shape realises effective self-sorting even in non-directional multivalent ionic interactions.