Companion planting around tomatoes is one of the few garden traditions where at least some of the folklore holds up in trials. Basil, marigolds, and nasturtiums are credited with reducing pest pressure on tomatoes, while corn, fennel, and brassicas cause real problems as neighbours. This guide ranks the 12 plants most often paired with tomatoes — six that earn their bed space, six to keep at a 4-foot minimum distance — with the spacing and reasoning behind each pairing. On my balcony I can’t run a full 4×8 companion-planted bed — I have fabric grow bags lined up along a rail — so the companion pairings below are filtered for what actually fits in containers: one basil pot tucked between two tomato bags, a dwarf marigold at each bag’s edge, and a handful of chives in the smallest corner spot. The principles scale whether you’re planting a full bed or a balcony rail. For overall bed prep and tomato spacing strategy, see the season-long playbook in Tomato Plant: Complete Outdoor Growing Guide.
How Companion Planting Actually Works for Tomatoes
Three real mechanisms drive companion planting effects, and understanding which one is at play matters more than memorizing pairings:
- Pest confusion or repulsion. Strong-scented herbs (basil, mint family) mask the volatile compounds tomato pests use to find their host plant.
- Beneficial insect attraction. Flowering companions (nasturtiums, marigolds, alyssum) attract pollinators and predatory insects that eat tomato pests.
- Resource competition. Bad companions either share the same diseases (other nightshades) or compete heavily for the same nutrients (heavy feeders like corn).
The mechanism that does not hold up: chemical “allelopathy” between unrelated plants. Most claims that one plant chemically suppresses another’s growth (outside of black walnut and a handful of similar examples) don’t survive controlled testing.

The Six Best Companion Plants for Tomatoes
1. Basil
The most-cited tomato companion, and the one with the most research behind it. Basil’s strong volatile oils are credited with deterring tomato hornworms, whiteflies, and aphids, and field trials report fewer hornworm eggs and less leaf damage on tomato beds interplanted with basil.
Spacing: Plant 1 basil per tomato, 12 to 18 inches from the tomato base. Don’t crowd — both plants need their own root zone.
Bonus: Tomato + basil is also one of the great culinary pairings. Plant a pot of Genovese basil seeds between every two tomato bags — same watering schedule, no extra effort, and you’re picking caprese ingredients from the same square meter of balcony. Plant once, harvest two ingredients all season.
2. Marigolds (French marigolds specifically — Tagetes patula)
French marigolds (Tagetes patula) release compounds from their roots that suppress root-knot nematodes — microscopic soil pests that damage tomato roots — and this nematode-suppressing effect is one of the better-documented reasons to grow them near vegetables (Clemson Cooperative Extension). The catch is that it works best as a dedicated cover-crop planting worked into the soil, so the effect is modest from a few edging plants in a single season but compounds if you plant marigolds in the same bed year after year. African marigolds (Tagetes erecta) do not reliably share the trait, so match the species to the goal.
Spacing: Border the bed perimeter, plus 1 marigold every 4 feet between tomatoes. I tuck a dwarf French marigold at the edge of each fabric grow bag — ‘Naughty Marietta’ is the compact variety that fits a 5-gallon bag’s rim without competing for root space. Use French marigolds, not African (Tagetes erecta) — only French marigolds have the nematode-suppressing trait.

3. Nasturtiums
Aphid trap crop. Aphids preferentially colonize nasturtiums over tomatoes, allowing easy removal of the entire infested plant. The bright flowers also attract pollinators and predatory wasps.
Spacing: Plant along bed edges or as a low groundcover. Nasturtiums sprawl — keep them 18+ inches from tomato bases or they’ll smother low foliage.
4. Carrots
Carrots and tomatoes have non-overlapping root zones — carrots go straight down 8 to 12 inches, tomatoes spread laterally in the top 12. Both can occupy the same bed without competition. Carrots also benefit from the partial shade tomatoes provide in summer.
Spacing: Sow carrots 6 inches from tomato bases. Harvest carrots before tomato canopy fully closes.
5. Garlic and Chives
Allium-family plants (garlic, chives, onions, leeks) repel aphids and spider mites with their sulfur compounds. Garlic also reportedly reduces fungal disease pressure, though evidence here is weaker.
Spacing: 6 to 12 inches from tomato bases. Garlic planted in fall as overwinter crop and harvested mid-summer fits perfectly into the tomato bed cycle.
6. Borage
Underrated companion. Borage flowers attract bumblebees (which buzz-pollinate tomatoes very effectively) and predatory wasps. The fuzzy leaves also deter tomato hornworm moths from laying eggs.
Spacing: 1 borage plant per 6 to 8 tomato plants. Borage self-seeds aggressively — pull volunteers in subsequent years if you don’t want it taking over.

The Six Plants to Keep Away from Tomatoes
1. Brassicas (cabbage, broccoli, cauliflower, kale, Brussels sprouts)
Heavy feeders that compete directly with tomatoes for the same nutrients in the same root zone. Both are also susceptible to overlapping pest pressure (cabbage moth caterpillars will defoliate tomato seedlings if their preferred crop is unavailable). Keep brassicas in a separate bed.
Minimum distance: 4 feet, ideally a different bed entirely.
2. Corn
Corn earworm and tomato fruitworm are the same insect — Helicoverpa zea. Planting corn next to tomatoes essentially doubles the available host habitat and amplifies the pest population for both crops.
Minimum distance: 10 feet, or skip one entirely.
3. Fennel
One of the few real allelopathy cases. Fennel releases compounds that inhibit growth of most nearby plants — tomatoes included. Fennel deserves its own dedicated bed away from everything else.
Minimum distance: Different bed.
4. Other Nightshades (potatoes, peppers, eggplant)
Same family (Solanaceae), same diseases. Late blight, early blight, verticillium, and fusarium wilt all spread between nightshades. Planting potatoes next to tomatoes especially raises late blight risk — a single infected potato plant can wipe out a tomato bed in a week.
Peppers and eggplant are less risky than potatoes and can share a bed if you accept the elevated disease risk, but rotate the entire nightshade family together — never plant tomatoes where potatoes grew last year (or vice versa).
Minimum distance: 4 feet from peppers/eggplant; 10 feet from potatoes; 3-year rotation between any nightshades in the same bed.
5. Walnut Trees (Black Walnut Specifically)
The poster child for allelopathy. Black walnut roots release juglone, a compound that’s actively toxic to tomatoes (and many other vegetables). Affected plants wilt and die within weeks despite normal watering and care.
Minimum distance: 50+ feet from a black walnut tree, or grow tomatoes in raised beds with imported soil.
6. Dill (After Flowering)
Dill is fine when young — it actually attracts beneficial insects. But mature flowering dill stunts tomato growth measurably. The fix: harvest dill heavily before flowering, or grow it in a separate bed.
Minimum distance: 3 feet, with mandatory pre-flower harvest.
Bed Layout: Putting It All Together
A practical 4×8 foot raised bed designed around tomato companion planting:
- Center row: 3 indeterminate tomatoes spaced 36 inches apart.
- Edges (long sides): Alternating basil and French marigolds, one per foot.
- Corners: Borage (1 plant) and chives (1 cluster).
- Underplanting: Carrots sown along the bed center in early spring, harvested before tomato canopy closes.
- Bed edges: Trailing nasturtiums spilling over the sides.
For raised bed construction and soil mix, see Raised Beds and Planters: Complete Guide and Best Soil for Raised Beds. For broader herb companion choices, the Growing Herbs Indoors guide covers indoor seed starting for the basil and chive companions.
Rotation: The Often-Skipped Long-Game
Beyond which plants share a bed in a single season, what you plant where in previous seasons matters as much for tomato yield. Soil-borne tomato diseases accumulate over multi-year monoculture. The minimum rotation: tomatoes go in a bed only every third year, with non-nightshades (legumes, brassicas, alliums, leafy greens) filling the off years.
For the season-long care arc that ties companion planting in with feeding, support, and pest management, see Tomato Plant: Complete Outdoor Growing Guide and Fertilizing Tomatoes: NPK Schedule.
On a balcony the companion-planting translation is straightforward: one pot of basil, one dwarf marigold, and one clump of chives per 5-gallon tomato bag. That trio covers pest deterrence, nematode suppression, and pollinator attraction in the minimum possible footprint. Skip the sprawling nasturtiums on a small balcony — they attract aphids and in a container setup without the predator-insect population of an in-ground bed, you’ll spend the season fighting them. A set of sturdy square tomato cages and the companion pots around them is the complete balcony tomato system I run every season. As an Amazon Associate I earn from qualifying purchases.
Companion Planting on a Small Balcony
On a balcony where square footage is measured in inches not acres, companion planting has to earn its place. I plant dwarf French marigolds at the base of every tomato pot because they deter whiteflies and look good doing it, and I tuck basil into the gaps between pots where it gets enough sun without competing for root space. Chives go in the smallest leftover corner, where their onion scent seems to keep aphids off the nearest bag. The basil shares the same watering schedule as the tomatoes, and the two herbs I use most in the kitchen grow within arm’s reach of each other.
Basil and tomatoes share more than a culinary pairing. The basil roots occupy the top few inches of soil while the tomato roots go deep, so the two are not competing for the same resources — a Genovese basil tucked into the shaded edge of a Sungold tomato pot produces more than it does in its own separate container. The tomato canopy provides the partial shade that basil actually prefers on a south-facing balcony where the July sun can scorch basil leaves by midday, and because the two share the same watering schedule I harvest basil from the tomato pot right through July and August without ever watering or feeding it separately.
Frequently Asked Questions
What is the best companion plant for tomatoes?
Basil, by both folklore and modern trials. Basil’s volatile oils are credited with deterring tomato hornworms, whiteflies, and aphids, and field trials report fewer hornworm eggs and less leaf damage. Plant 1 basil per tomato, 12 to 18 inches from the tomato base.
Can I plant peppers next to tomatoes?
You can, but accept elevated disease risk — both are nightshades and share fusarium wilt, verticillium, and blight pathogens. Better practice is to dedicate one bed to all nightshades together, then rotate the whole bed to non-nightshades for 2 to 3 years.
Why are marigolds good for tomatoes?
French marigolds (Tagetes patula specifically — not African marigolds) release chemicals from their roots that suppress root-knot nematodes that damage tomato roots. The effect compounds across multiple seasons in the same bed.
What plants should never go near tomatoes?
Brassicas (cabbage, broccoli, kale), corn, fennel, and other nightshades planted in last year’s tomato bed. Black walnut trees release juglone that is actively toxic to tomatoes within a 50-foot radius.
Does companion planting really work or is it folklore?
It works for specific mechanisms backed by trials — pest deterrence by scented herbs, beneficial insect attraction by flowering companions, and resource non-competition between deep-rooted and shallow-rooted plants. Vague chemical-allelopathy claims between unrelated plants mostly do not survive testing.
How far apart should companion plants be from tomatoes?
Beneficial companions like basil and marigolds: 12 to 18 inches from tomato base. Plants to avoid: minimum 4 feet (or different bed) for brassicas and other nightshades, 10 feet for corn and potatoes, 50 feet from black walnut trees.
