Plant basil, carrots, and marigolds near tomatoes to improve growth and pest control

Certain plants grown alongside tomatoes reduce pest damage, improve soil nutrients, and make better use of garden space. Companion planting pairs tomatoes with plants that either repel insects that harm tomatoes, attract beneficial insects, or use different soil depths so they do not compete for water and nutrients. The most reliable companions are basil, which repels spider mites and flies; carrots, which loosen soil without competing for nutrients; and marigolds, which deter nematodes and whiteflies.

Companion planting is not magic—it works through real mechanisms. A basil plant next to a tomato does not chemically protect it, but basil's strong smell masks the tomato plant's scent from some pests, making them less likely to land on it. Marigolds produce compounds in their roots that kill certain soil-dwelling pests. Carrots have shallow roots while tomatoes go deep, so they pull water and nutrients from different layers. The effect is modest but measurable: gardeners who use companions report fewer pest problems and slightly higher yields than those who plant tomatoes alone.

Key Takeaways

  • Basil planted within 12 inches of tomato stems repels spider mites, whiteflies, and some flies without requiring any maintenance beyond normal watering.
  • Carrots, onions, and parsley do not compete with tomatoes for nutrients because they root at different depths, so they can grow in the same bed without reducing tomato yield.
  • Marigolds planted around tomato beds deter nematodes and some beetles, though they work best when planted densely (one marigold per 2 to 3 square feet).
  • Avoid planting tomatoes near brassicas (cabbage, broccoli, kale) and fennel, which compete for the same nutrients and can stunt both plants.
  • Companion plants work best when they are already healthy—a weak basil plant will not repel pests, so water and feed companions as you would the tomatoes.

The best companions for pest control

Basil is the most effective pest-control companion for tomatoes. Plant it 12 inches or closer to the tomato stem. Basil repels spider mites, which cause yellowing and webbing on tomato leaves, and also deters whiteflies and some flies. The smell of basil is strong enough to confuse pests looking for tomato plants by scent. Basil also grows quickly in warm weather, so it will be mature enough to be effective by the time tomato pests become active in mid-summer.

Marigolds work through a different mechanism: their roots release compounds that kill root-knot nematodes, which are microscopic pests that live in soil and damage tomato roots. Plant marigolds densely around the tomato bed—one plant per 2 to 3 square feet—because a single marigold at the edge of the garden will not protect the whole bed. Marigolds also attract hoverflies, which eat aphids. They are inexpensive, grow in poor soil, and bloom all summer, making them a low-effort addition to any tomato bed.

Nasturtiums act as a trap crop: pests prefer them to tomatoes, so they congregate on the nasturtiums instead. Plant nasturtiums around the perimeter of the tomato bed, not mixed in with the tomatoes themselves. Aphids will move to the nasturtiums, leaving the tomatoes alone. This works only if you are willing to let the nasturtiums be damaged—if you spray them with pesticide, you defeat the purpose.

Companions that improve soil and save space

Carrots, onions, and parsley are shallow-rooted plants that do not compete with tomatoes for water and nutrients. Tomatoes root 18 to 24 inches deep; carrots root 8 to 12 inches deep; onions and parsley root 6 to 8 inches deep. Because they pull from different soil layers, all three can grow in the same bed without reducing tomato yield. Carrots also loosen compacted soil as they grow, which makes it easier for tomato roots to penetrate deeper.

Borage is a tall plant with shallow roots that attracts pollinators and beneficial wasps. Plant it on the north side of the tomato bed so it does not shade the tomatoes. Borage also attracts bees, which improve tomato pollination and fruit set. The plant self-seeds, so one borage plant can spread across the garden in subsequent years—remove seedlings if they crowd the tomatoes.

Chives and garlic repel some pests and do not compete with tomatoes. Both are perennials or semi-perennials, so they will return year after year if you leave them in place. Plant them at the edge of the bed rather than directly next to the tomato stem, because they prefer cooler, slightly drier conditions than tomatoes do.

Plants to keep away from tomatoes

Brassicas—cabbage, broccoli, kale, and cauliflower—compete with tomatoes for the same nutrients, especially nitrogen and potassium. Both plants are heavy feeders, so growing them together will stunt both. Plant brassicas in a separate bed or in a different part of the garden. The same rule applies to peppers and eggplants, which are in the same plant family as tomatoes and have identical nutrient needs.

Fennel is allelopathic, meaning it releases compounds that inhibit the growth of nearby plants. Tomatoes grown near fennel are often stunted and produce fewer fruits. Keep fennel at least 3 feet away from tomatoes, or grow it in a separate area of the garden entirely.

Potatoes are also in the tomato family and attract the same pests—particularly the tomato hornworm and early blight fungus. Growing them together increases pest and disease pressure on both crops. Plant potatoes in a different bed, and do not plant tomatoes in a bed where potatoes grew the previous year.

How to arrange companions in the garden bed

Plant basil and other herbs within 12 inches of the tomato stem, where they will benefit from the same watering and fertilizing schedule. Plant shallow-rooted vegetables like carrots and onions in rows between tomato plants, spacing them according to their own spacing needs (carrots 2 inches apart, onions 4 to 6 inches apart). Plant marigolds and nasturtiums around the perimeter of the bed, 12 to 18 inches from the tomato stem.

In a raised bed or container, plant one tomato plant per 5 square feet, then fill the remaining space with basil, marigolds, and one or two shallow-rooted plants. In an in-ground bed, space tomatoes 24 to 36 inches apart and plant companions in the gaps. Water all plants together—do not water companions separately, because they are now part of the same root zone.

Companion plants will shade the soil as they grow, which reduces water loss and keeps tomato roots cooler in hot weather. This is beneficial in most climates. In cool or cloudy regions, thin companions if they block more than 20 percent of the sunlight reaching the tomato plant, because tomatoes need at least 6 to 8 hours of direct sun daily.

Caring for companions so they work

A weak or stressed companion plant will not repel pests or improve soil. Water basil, marigolds, and other companions on the same schedule as your tomatoes. If you are drip-irrigating the tomatoes, run the drip line past the companions as well. Fertilize companions with the same balanced fertilizer you use for tomatoes—a 10-10-10 or similar blend applied every 2 to 3 weeks during the growing season.

Pinch off basil flowers as they appear to encourage leaf growth and keep the plant bushy. Deadhead marigolds (remove spent flowers) to encourage continuous blooming throughout the summer. Remove any companion plant that becomes diseased or heavily infested with pests, because a sick companion will not help and may spread disease to the tomatoes.

At the end of the season, pull up annual companions like basil and marigolds and add them to the compost pile. Leave perennial companions like chives in place if they are healthy, or dig them up and replant them in a new location the following year. Do not compost any plant material that shows signs of disease.

Frequently Asked Questions

Can I plant tomatoes with lettuce and spinach?

Yes. Lettuce and spinach are shallow-rooted and do not compete with tomatoes. They also prefer partial shade, which tomato plants provide in hot weather. Plant them on the south or west side of the tomato bed where they will get afternoon shade. Harvest them before they grow tall enough to shade the tomato plant itself.

Do I need to use all the companion plants or just a few?

A few well-chosen companions are more effective than many poorly maintained ones. Start with basil and marigolds, which are the most reliable. Add carrots or onions if you have space. You do not need every companion plant listed to see a benefit.

What if I plant companions and still get pests?

Companion plants reduce pest pressure but do not eliminate it entirely. If pests become severe, inspect the tomato plant and companions for signs of disease, may support they are watered and fertilized adequately, and consider removing heavily infested leaves. Spray with neem oil or insecticidal soap if pests persist, following label directions.

Can I plant tomatoes with herbs like oregano and thyme?

Yes. Oregano and thyme are Mediterranean herbs that tolerate the same dry, warm conditions as tomatoes. They have shallow roots and do not compete for nutrients. Plant them at the edge of the bed, where they will receive full sun and good drainage.

Should I plant companions in containers with tomatoes?

Yes, but use a larger container. A 5-gallon pot holds one tomato plant alone; a 10-gallon pot or larger can hold one tomato plant plus basil and one shallow-rooted vegetable. may support the container has drainage holes and use high-quality potting soil, not garden soil, which compacts in containers.