Carrot fly finds your carrots by smell, drifting low across the ground until it picks up that unmistakable carroty scent. The cleverest companions for carrots are strong-smelling alliums — onions, spring onions, leeks, garlic — whose pungency masks the carrots and muddles the fly. Grow them in alternating rows and each crop helps hide the other (onion fly is fooled the same way).
It's worth being honest, though: scent-masking helps, but the most reliable defence is a physical barrier. Carrot fly flies low, so a 60cm wall of fine insect mesh or fleece around the bed keeps the vast majority out. Companion planting and a barrier together is the belt-and-braces approach.
Grow these alongside
Their scent masks the carrots and confuses carrot fly — the classic alternating-row pairing.
Another pungent allium that throws carrot fly off; the two grow happily side by side.
Strong-smelling and space-efficient — a good edge planting around a carrot bed.
Quick, low crops that fill the gaps between slow carrot rows before the carrots need the room.
Aromatic enough to help mask the bed, and pretty in flower for the bees.
Keep these apart
Close relatives that can cross-attract the same pests and may cross with carrots if left to seed.
Same family, prone to the same pests and diseases — don't grow them cheek by jowl.
Flowers worth tucking in
The blooms that pull pests away and bring in the bees — beauty that earns its keep.
Bring in hoverflies and brighten the edge of the bed.
Cheerful, edible, and a favourite of beneficial insects.
Common questions
Do onions really stop carrot fly?
They help. Strong-smelling onions and other alliums mask the carrots' scent and make it harder for carrot fly to home in. It's a genuine effect but not total — pair it with a fine mesh or fleece barrier for the most reliable results.
How do you plant carrots and onions together?
Sow each in its own dense row and alternate them down the bed — a row of carrots, a row of onions, and so on. Each row's scent helps hide the other, confusing both carrot fly and onion fly.
What should not be planted near carrots?
Avoid parsnips and other close relatives that share pests and diseases, and don't let dill flower right beside them.
Want the whole picture?
The complete companion planting guide →