Plant tomatoes near basil, carrots, and marigolds for healthier growth and pest control

Companion planting means growing certain plants close together because they help each other thrive. Some plants repel pests that attack tomatoes, others improve soil nutrients, and a few straightforward don't compete for the same resources. Basil, parsley, carrots, onions, garlic, marigolds, and nasturtiums are the most reliable companions for tomato plants in a home garden.

The reason this matters: tomatoes in isolation attract more pests, use up soil nutrients faster, and take up more space than they need to. A tomato plant surrounded by the right neighbors will produce more fruit, need fewer treatments, and leave room for other crops in a small garden.

Key Takeaways

  • Basil and parsley planted near tomatoes repel common pests like hornworms and whiteflies while improving flavor.
  • Root vegetables like carrots and onions grow below the soil while tomatoes grow above, so they don't compete for space or nutrients.
  • Marigolds and nasturtiums attract beneficial insects and trap pests that would otherwise damage tomato leaves and fruit.
  • Avoid planting tomatoes near brassicas (cabbage, broccoli), fennel, and potatoes, which compete for nutrients or attract the same pests.

Herbs that repel tomato pests

Basil is the most effective herb to plant alongside tomatoes. It repels spider mites, whiteflies, and hornworms—three of the most common tomato pests. Basil also improves the flavor of tomatoes when grown nearby, though the reason for this is not fully understood. Plant basil seedlings 12 inches away from the tomato stem, in the same soil, and water them together.

Parsley works similarly to basil but is less aggressive. It attracts hoverflies, which eat aphids and other soft-bodied pests. Parsley grows slowly and won't shade the tomato plant, so you can plant it closer—about 6 inches from the stem. Both herbs prefer the same watering schedule as tomatoes, so they integrate easily into your routine.

Cilantro and dill also attract beneficial insects, though they bolt quickly in hot weather. If you live in a warm climate, plant them early in the season and replace them once they flower.

Root vegetables that don't compete for space

Carrots, onions, garlic, and beets grow underground while tomatoes grow above ground. Because they use different soil layers, they don't compete for the same nutrients or water. You can plant them densely around the base of a tomato plant without reducing the tomato yield.

Carrots are particularly useful because their roots break up compacted soil, making it easier for tomato roots to spread. Onions and garlic repel some insects and improve soil structure. Plant these vegetables 4 to 6 inches from the tomato stem, depending on the mature size of the root vegetable. A single tomato plant can support two or three carrots, one onion, and several garlic cloves in the same square foot of soil.

Flowers that trap pests and attract pollinators

Marigolds are the most popular companion flower for tomatoes. They attract beneficial insects like ladybugs and parasitic wasps, which hunt aphids and other pests. Marigolds also release a scent that repels some insects. Plant them 12 inches from the tomato stem in a ring around the base, or scatter them throughout the garden bed.

Nasturtiums work differently—they act as a trap crop, meaning pests prefer them to tomatoes. Aphids and whiteflies will feed on nasturtiums instead of your tomato leaves. Plant nasturtiums at the edge of the garden bed, not directly next to the tomato, so pests land there first. You can remove infested nasturtiums and compost them without harming the tomato plant.

Borage attracts bees, which pollinate tomato flowers and increase fruit set. It also repels hornworms. Calendula (pot marigold) attracts hoverflies and can be harvested for tea or salads.

Plants to keep away from tomatoes

Brassicas—cabbage, broccoli, cauliflower, and kale—compete with tomatoes for nitrogen and potassium. Both crops are heavy feeders, so planting them together depletes soil faster and reduces yield for both. Keep brassicas at least 3 feet away from tomato plants, or grow them in separate beds.

Fennel releases a chemical that inhibits the growth of most plants, including tomatoes. Even a single fennel plant can reduce tomato productivity. Potatoes attract the same pests as tomatoes (particularly the Colorado potato beetle and early blight fungus) and should be grown in a different area of the garden.

Avoid planting tomatoes near walnut trees. Walnut roots release juglone, a toxin that kills or stunts most plants, including tomatoes. If you have a walnut tree, plant tomatoes at least 50 feet away.

How to arrange companion plants in a small space

In a 4-by-4-foot bed, you can grow one tomato plant with multiple companions. Plant the tomato in the center. Around it, plant basil or parsley 12 inches away on two sides. In the remaining space, plant carrots and onions in a ring 6 inches from the stem. At the edges of the bed, plant marigolds or nasturtiums. This arrangement uses the full space without crowding the tomato plant.

In containers, the same principle applies but at smaller scale. A 5-gallon pot can hold one tomato plant and one basil plant. A 10-gallon pot can hold a tomato, basil, and a few carrots. Water the entire container together, since all plants share the same soil moisture.

In a larger garden bed, plant tomatoes 24 to 36 inches apart (depending on variety) and fill the space between them with herbs, flowers, and root vegetables. This maximizes yield per square foot and reduces pest pressure across the entire bed.

Timing and spacing for best results

Plant companion herbs and flowers at the same time as the tomato seedling, or a few days before. This gives them time to establish roots before the tomato plant grows large and shades them. Root vegetables can be planted at the same time or up to two weeks later, since they grow slowly and won't compete during the tomato's early growth phase.

Space plants according to their mature size, not their current size. A basil seedling looks small, but it will grow to 12 to 18 inches wide. A carrot seedling is tiny, but the root will be 6 to 8 inches long. Check the seed packet or plant label for mature dimensions, and measure from the tomato stem outward.

If you're growing determinate tomatoes (bush varieties that stop growing at a set height), you can plant companions closer together. If you're growing indeterminate tomatoes (vining varieties that grow all season), space companions farther apart to avoid shading as the tomato plant expands.

Frequently Asked Questions

Can I plant tomatoes next to peppers?

Yes. Peppers and tomatoes are both nightshades and attract some of the same pests, but they don't compete significantly for nutrients or water. Plant them 18 to 24 inches apart. The same companion plants that help tomatoes—basil, marigolds, and carrots—also benefit peppers.

What if I don't have space for companion plants?

Companion planting helps but isn't required. A tomato plant will produce fruit on its own. If space is limited, focus on the most effective companions: basil for pest control and carrots for soil improvement. Even one basil plant next to a tomato reduces pest damage noticeably.

Do I need to remove companion plants when I harvest tomatoes?

No. Basil, parsley, and marigolds can stay in the bed and be harvested alongside tomatoes. Root vegetables are harvested when mature (usually 60 to 80 days after planting), which may be before or after tomato season ends. Nasturtiums can stay until frost or until you decide to clear the bed.

Can I plant tomatoes where I grew brassicas last year?

Yes, but wait at least one season. Brassicas and tomatoes compete for the same nutrients, so soil depleted by brassicas will need amendment before tomatoes thrive. Add compost or a balanced fertilizer in spring before planting tomatoes.

What's the difference between a companion plant and a trap crop?

A companion plant helps the tomato directly—by repelling pests, improving soil, or attracting pollinators. A trap crop (like nasturtiums) sacrifices itself to draw pests away from the tomato. Both reduce pest damage, but they work in different ways.