Human carbonic anhydrase IX (CA IX), a protein specifically expressed on the surface of solid tumour cells, represents a validated target both for anticancer therapy and diagnostics. We recently identified sulfonamide dicarbaboranes as promising inhibitors of CA IX with favourable activities both in vitro and in vivo. To explain their selectivity and potency, we performed detailed X-ray structural analysis of their interactions within the active sites of CA IX and CA II. Series of compounds bearing various aliphatic linkers between the dicarbaborane cluster and sulfonamide group were examined. Preferential binding towards the hydrophobic part of the active site cavity was observed. Selectivity towards CA IX lies in the shape complementarity of the dicarbaborane cluster with a specific CA IX hydrophobic patch containing V131 residue. The bulky side chain of F131 residue in CA II alters the shape of the catalytic cavity, disrupting favourable interactions of the spherical dicarbaborane cluster.