The cortex organizes sensory information to enable discrimination and generalization. As systematic representations of chemical odour space have not yet been described in the olfactory cortex, it remains unclear how odour relationships are encoded to place chemically distinct but similar odours, such as lemon and orange, into perceptual categories, such as citrus. Here, by combining chemoinformatics and multiphoton imaging in the mouse, we show that both the piriform cortex and its sensory inputs from the olfactory bulb represent chemical odour relationships through correlated patterns of activity. However, cortical odour codes differ from those in the bulb: cortex more strongly clusters together representations for related odours, selectively rewrites pairwise odour relationships, and better matches odour perception. The bulb-to-cortex transformation depends on the associative network originating within the piriform cortex, and can be reshaped by passive odour experience. Thus, cortex actively builds a structured representation of chemical odour space that highlights odour relationships; this representation is similar across individuals but remains plastic, suggesting a means through which the olfactory system can assign related odour cues to common and yet personalized percepts.