What is companion planting?
Companion planting is the practice of growing different plants near each other to create mutual benefits. It's one of the oldest gardening techniques in the world — and one of the most misunderstood.
Done well, companion planting can: deter pests naturally without chemicals, attract beneficial insects and pollinators, improve soil nitrogen levels, maximize space, and boost flavor or yield of neighboring crops.
Done poorly — or based on folklore rather than evidence — it does nothing, or occasionally causes harm by creating competition for nutrients, water, or light.
The most important rule: Get the basics right first. Sun, soil, water, and spacing matter far more than companion planting. Think of companions as a bonus layer — not a replacement for good growing conditions.
How companion planting actually works
There are four main mechanisms that explain why certain plant pairings work:
1. Pest deterrence through scent
Strongly scented plants like basil, garlic, and marigolds confuse or repel insects that navigate by smell. Aphids and whiteflies, for example, have a much harder time finding tomato plants when basil is planted nearby — the competing scent disrupts their ability to locate their host.
2. Attracting beneficial insects
Flowers like marigolds, nasturtiums, dill, and borage attract predatory insects — ladybugs, lacewings, hoverflies — that eat the pests damaging your crops. They also attract pollinators, which increases fruit set in crops like beans, cucumbers, and tomatoes.
3. Soil improvement through nitrogen fixation
Legumes (beans and peas) have a symbiotic relationship with bacteria in the soil that converts atmospheric nitrogen into a form plants can use. Growing legumes near heavy feeders like corn or brassicas gradually improves soil fertility for the neighboring plants.
4. Physical complementarity
The classic example is the Three Sisters — corn, beans, and squash — grown together by Indigenous farmers across the Americas. Corn provides a pole for beans to climb. Beans fix nitrogen in the soil. Squash shades the ground, retaining moisture and suppressing weeds. Three crops, each making the others more productive.
The 5 companion planting pairs every gardener should know
Tomato + Basil
The most cited companion pair in gardening. Basil is believed to repel thrips, aphids, and whiteflies — all common tomato pests. Some gardeners also report improved tomato flavor near basil, though this is harder to measure scientifically. They also share similar growing conditions: full sun, warm temperatures, consistent water. Easy to plant, easy to harvest together.
Carrot + Onion (or Leek)
Carrot fly and onion fly are both serious garden pests. Carrot fly is deterred by the scent of onions; onion fly is deterred by the scent of carrots. Growing them in alternating rows or in nearby squares confuses both pests. This is one of the more well-supported companion planting combinations in garden research.
Brassicas + Nasturtium
Nasturtiums act as a trap crop for aphids — aphids are so strongly attracted to them that they colonize the nasturtium and leave your cabbage, broccoli, and kale relatively undisturbed. Plant nasturtiums at the edge of your bed or interspersed throughout. As a bonus, nasturtium flowers are edible and add a peppery kick to salads.
Corn + Beans + Squash (Three Sisters)
This combination has been used for thousands of years. Corn provides vertical support for pole beans. Beans fix atmospheric nitrogen and feed the heavy-feeding corn. Squash covers the ground, retaining moisture and preventing weeds from competing. Together, they produce more per square foot than any of the three crops grown separately.
Any vegetable + Marigold
French marigolds (Tagetes patula) are probably the single most useful companion plant in the vegetable garden. They repel nematodes in the soil, deter aphids and whiteflies, and attract beneficial insects. Research has confirmed that marigolds planted near tomatoes and peppers reduce whitefly populations measurably. Plant them throughout your beds, not just at the borders.
Companion planting combinations to avoid
Fennel + Almost everything
Fennel releases allelopathic compounds from its roots that inhibit the germination and growth of most other vegetables. It is particularly harmful to tomatoes, peppers, bush beans, and kohlrabi. Grow fennel in a separate container or in a dedicated bed away from your main vegetable garden. It's one of the few plants that is genuinely bad to have near others.
Onion + Beans or Peas
Onions, garlic, leeks, and other alliums inhibit the growth of beans and peas when planted nearby. The exact mechanism isn't fully understood, but it's one of the most consistently observed incompatible pairings in gardening — keep them well separated in your bed layout.
Brassicas + Tomatoes
Brassicas (cabbage, broccoli, kale, cauliflower) compete heavily with tomatoes for nutrients and are said to inhibit each other's growth. They also attract completely different pest sets, meaning you'd need conflicting deterrent plants nearby. Keep nightshades and brassicas in separate beds where possible.
Mint + Everything (in the ground)
Mint is an aggressive spreader. Left unchecked in a bed, it will colonize every available square foot and crowd out nearby crops. Mint belongs in a container — where it's excellent at deterring aphids and other pests when placed near the bed, without taking over.
The complete companion planting chart
Use this chart as a reference when planning your garden layout. The "good companions" are plants known to benefit each other when grown nearby. The "avoid" column lists combinations that compete or inhibit growth.
| Plant | Good companions | Avoid |
|---|---|---|
| Tomato | Basil, marigold, carrot, parsley, borage | Fennel, brassicas, corn |
| Pepper | Basil, tomato, carrot, marigold | Fennel, kohlrabi |
| Cucumber | Beans, peas, radish, marigold, nasturtium, dill | Sage, potato, aromatic herbs |
| Zucchini / Squash | Corn, beans, nasturtium, borage | Potato |
| Carrot | Onion, leek, lettuce, rosemary, sage, tomato | Dill (when mature), fennel |
| Lettuce | Carrot, radish, strawberry, chives, garlic | Celery, parsley |
| Spinach | Strawberry, peas, beans, celery | None known |
| Beans (bush) | Carrot, cucumber, peas, squash, strawberry, marigold | Onion, garlic, fennel, pepper |
| Peas | Carrot, corn, cucumber, beans, radish, spinach | Onion, garlic, leek |
| Onion / Garlic | Carrot, beet, lettuce, chamomile, tomato | Beans, peas, sage |
| Broccoli / Cabbage | Dill, celery, onion, potato, nasturtium, rosemary | Tomato, pepper, strawberry, fennel |
| Kale | Beet, celery, herb, nasturtium | Tomato, bean, strawberry |
| Corn | Beans, squash, cucumber, sunflower, melon | Tomato, fennel |
| Radish | Carrot, lettuce, spinach, cucumber, peas | Hyssop |
| Strawberry | Lettuce, spinach, thyme, sage, beans | Brassicas, fennel |
| Basil | Tomato, pepper, asparagus, oregano | Sage, thyme |
| Dill | Cabbage, lettuce, cucumber, onion, corn | Carrot (mature dill), tomato, fennel |
| Marigold | Everything — plant throughout the bed | Nothing known |
| Nasturtium | Brassicas, cucumber, squash, tomato | Nothing known |
| Fennel | Grow alone or with dill only | Almost everything |
Herbs as companion plants
Herbs are some of the most useful companion plants in the vegetable garden. Most have strong scents that deter pests, and many also attract beneficial insects.
Basil
Plant near tomatoes and peppers. Repels aphids, thrips, and whiteflies. Pinch flowers regularly to keep the plant producing leaves — and to keep pest-deterring volatile compounds at peak concentration.
Rosemary
Strong scent deters cabbage moths, bean beetles, and carrot flies. Plant near brassicas and carrots. Drought tolerant — don't overwater it near crops that need more moisture.
Dill
Attracts predatory insects like wasps and lacewings that eat aphids and caterpillars. Plant near brassicas and cucumbers. Avoid planting near tomatoes or near mature carrots, as it can compete.
Borage
One of the best all-around companion plants. Attracts pollinators and predatory insects. Improves the flavor and growth of strawberries and tomatoes when planted nearby. Edible flowers are a bonus.
Chives
Repel aphids, Japanese beetles, and carrot flies. Plant near roses, carrots, and tomatoes. Easy to grow and mostly perennial — plant once and they return every year.
How to plan companion planting in your garden layout
The most effective way to use companion planting is to integrate it into your garden layout from the start — not as an afterthought after everything is already planted.
When you're mapping your beds, think about which crops you're planting in each square and which companions would help them. A few principles to follow:
- Scatter marigolds and nasturtiums throughout every bed — they help everything and hurt nothing.
- Put basil next to (not far from) your tomatoes — proximity matters. Companion benefits fade quickly with distance.
- Keep fennel completely separate — it's the one plant that genuinely doesn't belong in a mixed bed.
- Put herbs at the edges of beds — this makes them easy to harvest and positions them to deter pests approaching from outside.
- Grow mint in containers — place the containers next to beds where you want its deterrent effect, without letting it invade the soil.
See companion planting in your garden plan: Niwa shows you companion planting information for every plant in its library. When you add a plant to your garden layout, you can see which plants are good and bad neighbors — directly in the app. Download free →
What companion planting can't do
Companion planting won't eliminate pests or fix a garden that lacks good soil, sun, or water. It's a supplemental strategy — one layer of a healthy growing system.
Also worth noting: much companion planting advice on the internet is based on folklore rather than controlled research. The pairings in this guide are those with the most consistent evidence behind them, either from scientific studies or from very well-documented gardening practice. When you see claims about exotic companion effects without any explanation of the mechanism — be skeptical.
The basics are real and worth practicing. Marigolds repel nematodes. Nasturtiums trap aphids. Legumes fix nitrogen. Strongly scented herbs deter pest insects. Start there, and build from experience in your own garden.