One of the most satisfying things you can do in your vegetable garden is let your plants work together. The right neighbors do things you can’t do with any spray or fertilizer — they confuse and repel pests, attract the beneficial insects that do free pest control, improve pollination, and even enhance the flavor of the tomatoes growing next to them.
Companion planting isn’t garden folklore. At least not entirely. Some companions have real, documented mechanisms behind their effects. Others have been trusted by generations of gardeners with results consistent enough to take seriously. In this guide, we’ll be clear about which is which.
We’ll cover the best companion plants for tomatoes, what each one actually does (and the science or evidence behind it), the worst plants to put near tomatoes, and how to lay out a tomato bed with companions built in from the start.
Quick Answer: The 3 best companion plants for tomatoes are basil (repels thrips and aphids, may improve flavor), marigolds (repel whiteflies, kill soil nematodes), and nasturtiums (trap crop for aphids). The 3 worst are fennel (allelopathic — inhibits tomato growth), brassicas (compete heavily for nutrients), and corn (share diseases and attract the same pests).
(You could use the table of contents on the right sidebar to jump to the section most useful to you.)
What Is Companion Planting and Does It Actually Work?
Companion planting is the practice of growing different plants in close proximity because they benefit each other — or because keeping them apart prevents them from harming each other.
For tomatoes specifically, companion plants work through a few proven mechanisms:
- Chemical repellents: Some plants produce volatile compounds that pests find repellent. Basil produces linalool and eugenol that deter thrips. Marigolds produce alpha-terthienyl, a compound toxic to nematodes in the soil.
- Trap cropping: Some plants attract pest insects away from tomatoes. Nasturtiums are irresistible to aphids — if you plant them nearby, aphids colonize the nasturtiums instead of your tomatoes.
- Pollinator attraction: Flowering companions attract bees and other pollinators that then visit your tomatoes, improving pollination and fruit set.
- Beneficial insect habitat: Some plants provide food (pollen and nectar) for parasitic wasps, lacewings, and hoverflies that prey on tomato pests.
- Allelopathy: Some plants release chemicals that inhibit the growth of nearby plants. This is why fennel is on the “avoid” list — it suppresses the growth of tomatoes.
Companion planting is not magic, and it’s not a replacement for good growing practices. But used strategically, it genuinely reduces pest pressure, improves the diversity of your garden ecosystem, and makes the whole space work harder for you.
The Best Companion Plants for Tomatoes
Basil – Best Overall Companion
This is the classic tomato companion, and it earns the reputation. Basil produces volatile oils — primarily linalool and eugenol — that research has shown to deter thrips, aphids, and spider mites when planted in close proximity. A 2009 study published in the Journal of the American Society for Horticultural Science found that interplanting basil with tomatoes reduced thrips populations significantly compared to tomatoes grown alone.
Beyond the pest-repelling benefits, many experienced gardeners report that tomatoes grown near basil have more intense flavor — though this is difficult to measure scientifically, it’s a consistent enough observation to be worth testing for yourself.
How to use it: Plant basil 12–18 inches from your tomato plants. Don’t let the basil flower and go to seed — pinch flowers regularly to keep it producing the volatile oils that do the work. One basil plant per tomato plant is a good ratio.
Marigolds (French Marigolds, Not African) – Best for Pest Suppression
Marigolds are the most studied companion plant in vegetable gardening, and their effectiveness against nematodes is well-documented. French marigolds (Tagetes patula) produce alpha-terthienyl from their roots, a compound that is toxic to root-knot nematodes — microscopic soil pests that damage tomato roots. However, the effect requires growing marigolds densely for a full season before planting tomatoes in that soil. One ring of marigolds around a tomato plant for one season doesn’t eliminate nematodes.
Above-ground, marigold flowers attract aphid-eating hoverflies and repel whiteflies. The strong scent confuses and deters many insects that navigate by smell. They also attract pollinators that then visit nearby tomato flowers.
How to use them: Plant French marigolds (not the tall African variety — it’s less effective) densely around and between tomato plants. For nematode control, consider a full-season cover of French marigolds the year before planting tomatoes in a new bed.
Nasturtiums – Best Trap Crop
Nasturtiums are what gardeners call a “trap crop” — a plant that attracts pests so irresistibly that it pulls them away from your actual crop. Aphids love nasturtiums, and if you plant them at the perimeter of your tomato bed, aphids will colonize the nasturtiums first and often exclusively.
You can then either ignore the aphid-covered nasturtiums (the plant tolerates them well) or spray just the nasturtiums with insecticidal soap. Either way, your tomatoes stay cleaner.
As a bonus, nasturtium flowers are edible (peppery, lovely in salads), and the whole plant is said to deter squash bugs and whiteflies.
How to use them: Plant nasturtiums at the border of your tomato bed — not interplanted directly — so they form a perimeter barrier. Check them weekly for aphids and decide whether to treat or let them take the hit for your tomatoes.
Borage – Best for Pollinator Attraction
Borage is one of the best all-around companion plants in the vegetable garden. Its blue star-shaped flowers are intensely attractive to bumblebees — which are the primary pollinators of tomatoes. Tomatoes are self-pollinating but rely on vibration (buzz pollination) to release pollen, and bumblebees are the most effective natural pollinators for this.
Borage is also a host plant for many beneficial insects, including parasitic wasps that prey on tomato hornworm. And like nasturtiums, it’s said to repel tomato hornworm directly — though the evidence for this is more anecdotal than documented.
How to use it: Let borage grow freely in and around your tomato bed. It reseeds prolifically, so plant it once and it will return every year. Allow it to flower for maximum bee attraction.
Carrots – Best for Soil
Carrots are a quiet but useful tomato companion. Their deep root structure loosens compacted soil around tomato plants, improving drainage and aeration without any work from you. They also attract ground beetles — predatory insects that eat soil-dwelling pests including cutworm larvae.
Tomatoes in turn are said to improve carrot flavor — though like the basil-tomato flavor connection, this is difficult to verify scientifically. What is clear is that they don’t compete significantly and use different layers of the soil, making them efficient space companions.
How to use them: Sow carrots between tomato plants. Their feathery tops occupy a different visual and physical layer, so they coexist without crowding.
Garlic and Chives – Best for Pest Deterrence
Alliums — garlic, chives, and onions — produce sulfur compounds that many pests find repellent. Spider mites in particular are significantly deterred by the volatile sulfur compounds alliums release. Garlic spray is one of the most commonly used organic pest deterrents in the garden precisely because this compound is so effective.
Planted near tomatoes, garlic and chives create a chemical barrier that reduces pest activity in the immediate area. They also attract beneficial insects when allowed to flower — chive flowers in particular are excellent bee attractors.

How to use them: Plant garlic in fall to overwinter alongside your future tomato beds. In spring, plant chives between tomato transplants. Allow chive flowers to open for pollinator attraction.
Parsley, Dill, and Fennel (Grown Far Away) – For Beneficial Insects
A quick distinction: dill and parsley are good tomato companions when young. As they mature and flower, they attract parasitic wasps and hoverflies — both of which prey on tomato hornworm and aphids. Allowing them to flower near your tomato bed brings in a natural pest management team.
Fennel is the exception — see the Avoid section below. Only grow fennel well away from your tomato bed.
How to use them: Let a few parsley or dill plants bolt and flower at the edge of your tomato bed. The flowers are the important part for beneficial insects.
Sunflowers – For Pollination and Beauty
Sunflowers are heavy bee attractors — the large open flower heads provide a landing pad that brings bees into your garden in numbers that benefit everything nearby. Bees foraging on sunflowers will also visit tomato flowers while they’re in the area.
Tall sunflowers can also serve as a windbreak for indeterminate tomato varieties in exposed locations.
How to use them: Plant at the north side of your tomato bed so they don’t shade your tomatoes. Don’t plant them directly among tomatoes — give them their own row at the perimeter.
Quick Reference: Best Companion Plants for Tomatoes
| Plant | Primary Benefit | How to Plant |
|---|---|---|
| Basil | Repels thrips, aphids, spider mites; possible flavor improvement | 12–18 inches from each tomato plant; pinch flowers |
| French Marigolds | Nematode control (dense planting); repels whiteflies; attracts pollinators | Dense border planting around bed |
| Nasturtiums | Trap crop for aphids; deters whiteflies | Perimeter of bed, not interplanted |
| Borage | Attracts bumblebees for pollination; hosts parasitic wasps | Let it grow freely in and around the bed |
| Carrots | Loosens soil; attracts ground beetles | Sow between tomato plants |
| Garlic / Chives | Deters spider mites and aphids with sulfur compounds | Plant between tomatoes; allow chives to flower |
| Parsley / Dill | Attracts parasitic wasps when flowering | Allow to flower at bed edges |
| Sunflowers | Attracts bees; windbreak for tall plants | North side of bed; don’t shade tomatoes |
5 Plants to Keep Away From Tomatoes
Companion planting works both ways. The wrong neighbor can quietly hurt your tomatoes all season without you knowing why the plants aren’t performing. Here are the plants you should keep well away from your tomato bed.
Fennel – Strongest Negative Effect
Fennel is allelopathic to tomatoes — it releases chemicals from its roots that actively inhibit tomato growth. Even at a distance of several feet, fennel can slow down tomato plants. It’s also allelopathic to most other vegetable crops, which is why experienced gardeners keep fennel in a completely separate area or in its own pot. Grow fennel if you love it, but give it its own corner of the garden far from your tomatoes.
Corn – Disease and Pest Sharing
Corn and tomatoes share the same primary pest — the corn earworm and tomato fruitworm are the same insect (Helicoverpa zea) in different crops. Planting them together concentrates the pest population and gives it a two-crop buffet. They also share several fungal diseases. Keep corn well away from your tomato patch.
Brassicas (Cabbage, Broccoli, Kale, Cauliflower) – Heavy Competition
Brassicas and tomatoes are heavy feeders that compete intensely for the same nutrients — particularly calcium and nitrogen. Planted together, neither performs as well as it would with appropriate space. They also don’t have meaningful beneficial effects on each other. Just separate them.
Potatoes, Peppers, and Eggplant – Shared Disease Risk
All of these are in the same plant family as tomatoes (Solanaceae). Planting them together concentrates solanaceous diseases — particularly late blight, which spreads rapidly between all family members. If blight hits your potatoes, it will reach your tomatoes within days if they’re planted nearby. Keep all solanaceous crops in separate areas of your garden.
Apricot Trees – Pest Attraction
Apricot trees produce a chemical called juglone (in lower concentrations than black walnut trees) that is mildly allelopathic to tomatoes. More importantly, they host the same aphid species and several fungal diseases that transfer easily to tomatoes. Keep any Prunus family trees (apricot, cherry, plum, peach) at a reasonable distance from your tomato bed.
How to Plan a Companion Planting Tomato Bed
Here’s a practical layout for a 4×8 foot raised bed that incorporates companions effectively without overwhelming the tomatoes:
- Tomatoes (2–3 plants): Spaced 24–30 inches apart down the center of the bed
- Basil (3–4 plants): One plant alongside each tomato plant, 12–18 inches away
- French Marigolds: Border the entire bed — 6 inches in from each edge, spaced 8 inches apart
- Nasturtiums: One corner of the bed as a dedicated trap crop zone, or just outside the bed perimeter
- Chives: Fill remaining space between tomato and basil plants — they’re compact and don’t compete significantly
💡 The two-rule approach
If companion planting feels overwhelming, start with just two rules: plant basil next to every tomato, and ring your bed with French marigolds. Those two choices alone cover the most common pest problems — aphids, thrips, whiteflies, and nematodes — and improve your garden ecosystem more than any other two plants you could choose.
Frequently Asked Questions
Can I plant garlic directly between tomato plants?
Yes — garlic planted between tomatoes is a classic combination. The only consideration is spacing. Garlic needs about 6 inches of space and will be harvested in midsummer, leaving a gap that other plants can fill. It doesn’t significantly compete with tomatoes for nutrients.
Do companion plants eliminate the need for pesticides?
No — companion planting reduces pest pressure. It doesn’t eliminate it. In a year with high pest pressure or disease conditions, you’ll still need to monitor and treat. Think of companions as one layer of an integrated pest management strategy, not a replacement for all other tools.
Does planting basil next to tomatoes really improve tomato flavor?
The evidence is mostly anecdotal, but it’s consistent enough to be interesting. The more plausible mechanism is that basil’s volatile oils may slightly modify the microclimate around the tomato plant. What we can say definitively is that basil reduces certain pests, and healthier tomato plants with less stress produce better fruit. So if there’s a flavor benefit, it may be indirect.
How many marigolds do I need to see a benefit?
For above-ground pest repellence (whiteflies), a ring of marigolds around your tomato bed is enough. For nematode control in the soil, you need dense planting — essentially a cover crop of marigolds for a full growing season before planting tomatoes in that bed. For most home gardeners, the above-ground benefits are more immediately relevant.
🍅 More Tomato Growing Guides
Final Thoughts
We hope this guide has given you a clear and practical picture of which plants to put next to your tomatoes — and which ones to keep far away.
Companion planting is one of those strategies that rewards you more the more consistently you apply it. The garden that was built with companions in mind from the start produces better, requires fewer interventions, and is just more interesting to spend time in.
For the full guide to growing tomatoes from seed to harvest, our complete tomato growing guide covers every stage. For all our pest control guides in one place, our garden pest control guide has you covered.
Share this post with a fellow tomato grower who’s wondering what to plant alongside their crop this season — and let us know in the comments which companions you’re already using and what results you’ve seen. Happy growing!