Plant the wrong crops next to your tomatoes and you'll spend the season fighting shared pests, tangled roots and stunted growth. Plant the right ones, and your tomato bed practically takes care of itself -- better pest control, more efficient use of space, and in some cases, a genuine bump in flavor and yield.
The short answer: basil, marigolds, onions, garlic, carrots, lettuce, peppers and borage are the best companions for tomatoes. Corn, potatoes, fennel, brassicas and dill are the ones to keep away.
Below is why each of these pairings works (or doesn't), plus direct answers to the specific combinations gardeners ask about most -- tomatoes with peppers, tomatoes with cucumbers, and how to actually lay the bed out.
What Is Companion Planting, and Does It Actually Work?
Companion planting means growing two or more crops near each other because of a benefit one gives the other -- pest confusion, shade, soil structure, or simply not competing for the same nutrients. Some of it is backed by research -- marigolds releasing compounds that deter root-knot nematodes, for example, a benefit summarized in Clemson Cooperative Extension's overview of companion planting benefits -- while some of it is generations of garden folklore that's never been formally tested but keeps getting repeated because gardeners see it work.
Either way, the practical case for it is simple: mixed plantings are harder for pests to find, they make better use of vertical and horizontal space, and they reduce the risk of one disease wiping out an entire bed. Treat it as smart garden planning first, folklore second.
10 Best Companion Plants for Tomatoes
1. Basil
Basil is the classic tomato pairing for a reason. It needs the same amount of sun and water as tomatoes, stays low enough not to shade them out, and its strong scent is widely credited with confusing the moths that lay hornworm eggs and repelling aphids. It's also the easiest companion to try in containers -- one tomato plant, one basil plant, same pot.
2. Marigolds
Marigolds release compounds from their roots that suppress root-knot nematodes, one of the more stubborn pests in tomato beds. Their bright flowers also draw in pollinators and predatory insects like hoverflies, which feed on aphids. Plant them as a border around the bed rather than directly under the tomato canopy, where they'll get shaded out.
3. Onions and Garlic
Alliums like onions and garlic have a sharp scent that masks the smell tomatoes give off, making it harder for pests to home in on the plant. They also grow straight down rather than out, so they slot into the gaps between tomato plants without competing for above-ground space.
4. Carrots
Carrots grow underground while tomatoes grow up, so the two rarely compete for light or root space. Carrots also loosen and aerate the soil as they grow, which improves drainage around the tomatoes' root zone. Just don't let tomato foliage shade them out completely -- carrots still need a reasonable amount of sun.
5. Lettuce and Other Leafy Greens
Lettuce, spinach and other quick-growing greens make excellent "living mulch." Plant them at the base of young tomato plants and harvest them before the tomato canopy fills in -- by the time the tomatoes need the space and sunlight, the greens are already on your plate. They also help shade the soil early in the season, keeping moisture in.
6. Peppers
Peppers and tomatoes are in the same plant family (Solanaceae) and want nearly identical conditions -- full sun, consistent watering, and warm soil. That makes them easy to plant side by side without adjusting your care routine. See the dedicated section below for the pests and diseases to watch for when pairing them.
7. Borage
Borage is less well known but highly effective -- its flowers attract bees and predatory wasps that prey on tomato hornworms, and some gardeners report it improves fruit set through better pollination. It self-seeds readily, so expect volunteers the following year.
8. Asparagus
In an established perennial bed, tomatoes and asparagus benefit each other in both directions: tomatoes release solanine, which is believed to repel the asparagus beetle, while asparagus is thought to deter root-knot nematodes that trouble tomatoes. This pairing only makes sense if you already have a permanent asparagus bed, since asparagus takes two to three years to establish.
9. Nasturtiums
Nasturtiums are often described as a "trap crop" for tomatoes -- aphids and squash bugs tend to prefer nasturtium leaves over tomato foliage, so planting them nearby can pull pest pressure away from the crop you actually want to protect. Their sprawling habit makes them a good living mulch along the outer edge of a bed, and both the leaves and flowers are edible, with a peppery bite similar to watercress.
10. Chives
Chives are a mild-mannered allium, and like onions and garlic, their scent is thought to confuse pests that key in on the smell of tomato foliage, while their narrow, upright growth habit takes up almost no lateral space. As a perennial, chives come back on their own each spring, so many gardeners plant a small clump at the corner of the tomato bed once and let it return year after year.
Plants You Should Avoid Planting Near Tomatoes
- Corn -- attracts the same pest, the corn earworm, which also feeds on tomato fruit as the tomato fruitworm. Growing them together makes an infestation more likely to spread between both crops.
- Potatoes -- another Solanaceae relative, but a risky one. Tomatoes and potatoes share susceptibility to early and late blight, and planting them together makes it easier for either disease to jump from one bed to the other.
- Fennel -- fennel is allelopathic, meaning it releases compounds into the soil that inhibit the growth of many neighboring plants, tomatoes included. Grow it well away from the vegetable bed.
- Brassicas (cabbage, broccoli, kale, cauliflower) -- these prefer cooler soil and different nutrient ratios than tomatoes, and the two compete heavily for the same resources when planted close together.
- Dill -- young dill can help tomatoes by attracting predatory insects, but once it matures and flowers, it's been shown to stunt tomato growth. If you grow it nearby, pull it before it flowers.
One more to flag if you're planting near trees rather than other vegetables: black walnut trees release a compound called juglone from their roots that is toxic to tomatoes, as documented by Michigan State University Extension. Keep tomato beds at least 50 feet from a mature black walnut.
Can You Plant Tomatoes and Peppers Together?
Yes -- tomatoes and peppers are one of the easiest pairings in the garden. Both are Solanaceae crops that want full sun, warm soil and steady, deep watering, so you can treat a mixed tomato-and-pepper bed as a single watering and feeding zone instead of managing two different schedules.
The trade-off is that being close relatives, they also share several pests and diseases -- aphids, hornworms, flea beetles, and blight. Space plants far enough apart for airflow (18-24 inches at minimum), rotate the whole bed to a new spot each year, and inspect both crops together, since an infestation rarely stays on just one.
Can You Plant Tomatoes and Cucumbers Together?
Generally yes, but with more caveats than the pepper pairing. Cucumbers are heavy feeders and vigorous vines, so left to sprawl they'll compete hard with tomatoes for nutrients, water and light.
The fix is to trellis the cucumbers vertically instead of letting them run along the ground. That keeps their footprint small, improves airflow for both plants, and cuts down on the powdery mildew risk that cucumbers are especially prone to in humid, low-airflow conditions. Give each plant its own generous root space rather than crowding them into the same planting hole.
How to Plan a Tomato Companion Planting Layout
- Border, don't crowd. Use low-growing companions like marigolds and alliums around the edge of the bed, not directly under the tomato canopy where they'll be shaded out by midsummer.
- Stagger by harvest speed. Fast-growing companions (lettuce, radish, spinach) can share space with tomatoes early in the season and come out before the tomatoes need the room.
- Give vertical growers a trellis. Cucumbers and pole beans should climb, not sprawl, if they're sharing a bed with tomatoes.
- Rotate the whole group next year. If tomatoes move to a new bed each season to manage soil-borne disease, their Solanaceae companions (peppers, potatoes) should move with the same rotation logic in mind -- keep tomatoes and potatoes in separate rotations entirely.
A Sample Companion Planting Layout for a 4x8 Raised Bed
It helps to see the theory turned into an actual plan. Take a standard 4-foot by 8-foot raised bed -- a size that fits comfortably in most backyard gardens and is large enough to test several companion pairings at once.
- Back row, against a fence or trellis: Three tomato plants spaced 24-30 inches apart, caged or trellised for vertical support.
- Between each tomato plant: A single onion or garlic set, tucked into the gap where it won't compete with the tomato's canopy.
- Front row, along the sunny edge: One basil plant per tomato, positioned so it gets morning sun but isn't shaded out once the tomatoes bulk up in midsummer.
- Border, all the way around: Marigolds spaced roughly 12 inches apart, doing double duty as a nematode-suppressing barrier and a pollinator draw.
- Any remaining gaps: Fast-growing lettuce or spinach, harvested out by early summer before the tomato canopy needs the room.
The logic behind this layout holds regardless of bed size: tall growers in back, sun-hungry companions along the front, alliums filling the dead space between plants, and a flowering border doing pest-control work at the perimeter. Scale the same ratios up or down for a bigger or smaller bed.
Companion Planting in Containers vs. In-Ground Beds
Companion planting works differently depending on where you're growing. In an in-ground bed or a large raised bed, root systems have room to spread without bumping into each other, so you can plant companions relatively close together and let each crop find its own space underground. A 4x8 bed like the one above can comfortably support tomatoes, basil, alliums and a marigold border all at once.
Containers are a different story. Every plant sharing a pot is also sharing a fixed, limited volume of soil, water and nutrients, so container companions need to be chosen for how little they compete rather than for every pest-control benefit they offer in the ground. A single tomato plant needs at least a 5-gallon container on its own; adding a companion means sizing up to a 10-15 gallon container or larger, or accepting that both plants will end up smaller than if grown separately.
Basil is the standout container companion because it stays compact and shallow-rooted enough not to starve the tomato. Marigolds also do well tucked into the edge of a large tomato pot. Skip vigorous spreaders like cucumbers, squash or full-size dill in a shared container -- in a pot, they'll outcompete the tomato for root space long before any pest-control benefit has a chance to matter.
Common Companion Planting Mistakes to Avoid
- Planting companions directly under the canopy. Marigolds, lettuce and other lower-growing companions need real sun. Tucked directly beneath a mature tomato plant, most will get shaded out by midsummer and stop pulling their weight.
- Treating companion planting as pest control on its own. Companion planting reduces pest pressure at the margins; it doesn't replace basic practices like watering at the soil line, pruning for airflow, and checking leaves regularly for early signs of hornworms or blight.
- Ignoring how large a companion will get. Dill is the classic example -- helpful to tomatoes while young, but capable of stunting them once it matures and flowers. Know a plant's mature size and habit before adding it to the bed, not after.
- Forgetting to rotate companions along with the tomatoes. If only the tomatoes move to a new bed each year while related companions like peppers or potatoes stay put, you've undermined the rotation and left soil-borne disease with a host to survive on.
- Assuming every pairing is backed by hard science. As West Virginia University Extension notes, companion planting is not an exact science -- some effects, like marigolds and nematodes, have real research behind them, while others are closer to garden folklore. Keep a simple record of what you plant and how it performs in your own beds, since results vary by climate, soil and the specific pests in your area.
Frequently Asked Questions
What grows well with tomatoes?
Basil, marigolds, onions, garlic, carrots, lettuce, peppers and borage all grow well with tomatoes -- they either repel common pests, make efficient use of garden space, or share the same sun, water and soil needs.
What should you never plant near tomatoes?
Avoid corn, potatoes, fennel, brassicas and mature dill. They compete for nutrients, share pests and diseases, or actively stunt tomato growth.
Can you plant tomatoes and basil in the same pot?
Yes -- basil is one of the best container companions for tomatoes. It needs a similar amount of water and sun, stays compact enough not to compete for space, and is widely believed to help repel aphids and hornworm moths.
Can you plant tomatoes and peppers together?
Yes. Tomatoes and peppers are both Solanaceae crops that want the same sun, warm soil and watering schedule, which makes them easy to grow side by side. Just space them 18-24 inches apart for airflow and watch both for the pests and diseases they share, like aphids and blight.
Can you plant tomatoes and cucumbers together?
Yes, as long as the cucumbers are trellised. Left to sprawl along the ground, cucumbers compete hard with tomatoes for water and nutrients, but trellising them vertically keeps their footprint small and improves airflow for both crops.
Do marigolds actually repel pests from tomatoes, or is that a myth?
It's a mix of both. The nematode-suppressing effect of marigold roots has real research behind it, while the idea that marigold scent alone repels above-ground pests like aphids is less rigorously proven and closer to long-standing garden folklore. Either way, marigolds cost little to try and bring in pollinators regardless.
How far apart should companion plants be from tomatoes?
Low-growing companions like marigolds, onions and lettuce can sit as close as 8-12 inches from a tomato plant since they won't compete for the same vertical space. Larger companions that need their own root zone, like peppers or cucumbers, are better spaced 18-24 inches away.
Can you plant tomatoes near roses or other flowers?
Roses and tomatoes aren't a classic pairing, but they aren't harmful to each other either -- both like full sun and well-drained soil. The bigger concern is that roses are prone to their own pest and fungal issues, so give them enough distance from tomatoes that treating one doesn't mean spraying the other.
Is there anything wrong with planting basil too close to tomatoes?
Basil rarely causes problems for tomatoes, but planting it directly against the main stem can restrict airflow at the base of the plant, which raises the risk of fungal issues in humid weather. Leave a few inches of breathing room and basil stays one of the safest companions to plant close.
Should companion plants be rotated each year like the tomatoes themselves?
Yes, at least the companions that are closely related to tomatoes. Peppers and potatoes are also Solanaceae crops, so if tomatoes move to a new bed each year to manage soil-borne disease, those companions should move with them rather than staying behind in the old bed.
Conclusion
Companion planting won't replace good watering, feeding and pest management, but it stacks the odds in your favor. Start simple -- basil and marigolds around your tomatoes is the highest-value, lowest-effort combination to try first -- then build out from there as you see what your garden responds to.
Thanks for reading!
