The Companion Planting Guide Every Vegetable Gardener Needs

Companion planting is one of those gardening topics surrounded by equal parts genuine science and gardening mythology. There are dozens of supposedly authoritative lists claiming that marigolds repel every pest, that basil makes tomatoes taste better, and that various plant combinations are either miraculous or disastrous.
Some of this is real. Some of it is folklore that’s been repeated so many times it’s accepted as fact. This guide focuses on what’s actually supported by observation and evidence—and acknowledges honestly where the science is thin.
What Companion Planting Actually Does (and Doesn’t Do)
What it does:
- Legumes fix nitrogen in the soil, benefiting neighboring plants
- Flowers attract beneficial insects that pollinate crops and prey on pest insects
- Dense interplanting suppresses weeds by leaving no bare soil
- Trap crops concentrate pest populations for easier management
- Tall plants shade low-growing plants that prefer partial shade
What the evidence doesn’t clearly support:
- That marigolds make nearby plants dramatically less tasty to all pests (they do deter some soil nematodes and some pests, but the all-purpose “marigolds repel everything” claim is overblown)
- That basil improves the flavor of tomatoes
- That plants “communicate” beneficial information to each other
The useful frame for companion planting: it’s a tool for space efficiency, pest management strategy, and ecological diversity—not a magical system where specific pairings produce predetermined outcomes.
Combinations That Work
The Three Sisters: Corn, Beans, and Squash
The most famous companion planting combination comes from Indigenous agricultural tradition and is genuinely effective.
How it works:
- Corn provides a vertical structure for pole beans to climb
- Beans fix atmospheric nitrogen, enriching soil for the corn and squash
- Squash’s large leaves shade the ground, conserving moisture and suppressing weeds
- The combination provides more food from the same space than growing any one crop alone
How to plant it:
- Plant corn first; when it’s 4-6 inches tall, plant beans around the base
- Plant squash 2-3 weeks after corn, outside the beans
- Use pole beans (not bush); use spreading winter squash or pumpkin (not compact types)
- Space corn generously—at least 12 inches between plants—to accommodate the beans
This combination works best with traditional corn varieties rather than modern sweet corn hybrids, and with a block planting of at least 4x4 corn to ensure pollination.
Tomatoes and Basil
Possibly the most repeated companion planting claim. The flavor improvement claim isn’t supported by controlled research, but the combination makes practical sense:
- Basil is harvested regularly, requiring frequent trips to the tomato bed—which means you’re regularly checking on your tomatoes
- Both prefer warm, sunny, well-watered conditions
- Basil flowers attract beneficial insects
- Having them adjacent is convenient in the kitchen
It’s a fine pairing. Just don’t expect the basil to magically improve tomato flavor.
Brassicas and Nasturtiums
Nasturtiums as trap crops: Aphids, particularly black bean aphids, are strongly attracted to nasturtiums. A nasturtium planted near brassicas (broccoli, cabbage, kale) can concentrate aphid populations on the nasturtium, which you can then remove, blast with water, or treat—while your brassicas remain relatively pest-free.
This is genuine trap-cropping and it works. The catch: you need to actually monitor the nasturtiums and deal with the pest concentration, not just let it accumulate.
Carrots and Onions (the Folklore Version)
The claim: carrot fly is repelled by onion scent; onion fly is repelled by carrot scent; growing them together prevents both problems.
The reality: there is some evidence that the interplanting confuses pest insects, but it’s not a reliable solution to carrot fly on its own. Carrot fly populations in heavily infested areas will find your carrots regardless. The best carrot fly control remains physical barriers (fine mesh netting over beds).
The combination doesn’t hurt, and growing them together makes efficient use of space (they have different root depths). Worth doing, with realistic expectations.
Legumes Throughout the Garden
The clearest evidence in companion planting involves nitrogen-fixing legumes (beans, peas, clover). Legumes host bacteria (Rhizobium) in root nodules that convert atmospheric nitrogen into soil nitrogen that other plants can use.
Practical applications:
- Plant bush beans in gaps between other crops throughout the vegetable garden
- After peas finish in late spring, cut them at the soil line and leave roots (which contain nitrogen-rich nodules) to decompose
- Undersow brassicas with clover as a living mulch that fixes nitrogen and suppresses weeds
- Grow cover crops of crimson clover or hairy vetch in the off-season to build nitrogen for the following year
This is the most clearly evidenced benefit in companion planting, and it scales to whole-garden or whole-farm nitrogen management.
Flowers in the Vegetable Garden
A separate category from direct companionship, but important: intentional planting of flowering plants in and around the vegetable garden consistently improves pollination rates and beneficial insect populations.
Best flowers for vegetable gardens:
- Phacelia: Extremely high value to pollinators; tansy phacelia in particular produces abundant nectar for bees
- Sweet alyssum: Attracts hoverflies (predatory on aphids); good understory plant
- Borage: Attracts bumblebees; the blue flowers are edible
- Dill and fennel: Left to flower, these attract parasitic wasps that prey on many caterpillar pests
- Zinnias and cosmos: Generalist pollinator attractors; beautiful and long-blooming
- Marigolds: African marigolds (Tagetes erecta) have the best evidence for soil nematode suppression; plant densely in soil with nematode problems and work them in at season’s end
The research on beneficial insect attraction is solid: vegetable gardens with diverse flowering plants alongside them consistently show better pollination and higher populations of pest-predating insects.
Combinations to Actually Avoid
Genuine incompatibilities tend to be about competition or chemical effects:
-
Fennel with almost everything: Fennel releases allelopathic chemicals that inhibit germination and growth of many vegetables (tomatoes, peppers, beans are particularly affected). Grow fennel in its own spot, away from vegetable beds.
-
Garlic and onions with beans and peas: Alliums inhibit legume nitrogen fixation—the root bacteria that make legumes valuable as companions is suppressed in the presence of allium chemicals.
-
Brassicas with each other in the same family rotation: Not a companion planting issue per se, but worth noting—all brassicas share the same pest and disease issues. Diversifying what’s in your beds reduces concentrated vulnerability.
Planning Companion Planting
The most practical approach to companion planting is to:
- Design your beds primarily around the vegetables you want to grow
- Interplant flowers throughout for insect attraction (this always helps)
- Place nasturtiums near brassicas if aphids are a problem
- Grow legumes in gaps between other crops
- Keep fennel isolated
- Don’t overthink the rest—avoid known incompatibilities and you’re unlikely to create problems
Gardenly can help you visualize your garden layout as you plan out companion planting arrangements, which is particularly useful when you’re trying to figure out spacing and organization before anything goes in the ground.
The best companion planting strategy is one you can actually implement and maintain. A thoughtful garden with diverse plantings will almost always outperform a precisely planned companion planting chart that never makes it out of the notebook.