Plants That Keep Common Tomato Pests Away
The most effective insect-repelling companions for tomatoes are basil, marigolds, nasturtiums, and borage. Basil grows well in the same warm conditions as tomatoes and its strong smell masks the scent that pests like hornworms and whiteflies use to find your plants. Marigolds release a smell from their roots that deters spider mites and nematodes in the soil. Nasturtiums attract aphids away from tomatoes by acting as a trap crop—pests prefer them and leave your tomatoes alone. Borage attracts beneficial insects like bees and parasitic wasps that hunt tomato pests.
Plant basil 6 to 12 inches away from your tomato stem, where it will stay within reach for harvesting. Space marigolds and nasturtiums around the perimeter of your tomato bed, about 12 inches apart. Borage can grow taller and should go on the north side of your tomatoes so it doesn't shade them as it matures.
Key Takeaways
- Basil repels hornworms and whiteflies and thrives in the same warm soil and sunlight as tomatoes.
- Marigolds and nasturtiums work by either releasing pest-repelling compounds or attracting pests away from tomatoes to themselves.
- Borage and other flowering companions bring in parasitic wasps and other predatory insects that hunt tomato pests naturally.
- Spacing matters: keep basil close (6 to 12 inches), marigolds and nasturtiums at 12 inches, and taller plants like borage where they won't shade your tomatoes.
- Companion planting works best as one layer of pest control, not as a complete replacement for removing damaged leaves or managing severe infestations by hand.
How Basil Protects Tomatoes From Hornworms and Whiteflies
Basil's strong aromatic oils confuse the insects that hunt tomatoes by smell. Hornworms and whiteflies rely on scent to locate host plants, and basil's odor masks the chemical signals tomato leaves give off. When basil grows within a few inches of your tomato plant, the pest has a harder time finding the tomato underneath.
Basil also prefers the same conditions as tomatoes—full sun, warm soil, and regular water—so they grow well side by side without competing. Plant basil seedlings or seeds at the same time you transplant tomatoes, or wait until soil temperatures reach 70°F if you are direct-seeding. Pinch off basil flowers as they appear to keep the plant bushy and productive longer. You can harvest leaves for cooking while the plant is still protecting your tomatoes.
Marigolds and Nasturtiums as Trap Crops and Root Protectors
Marigolds work in two ways. Their roots release compounds into the soil that repel root-damaging nematodes, which are microscopic pests that feed on tomato roots and stunt growth. At the same time, marigold flowers and foliage deter spider mites and some beetles from settling on nearby plants. Plant marigolds in clusters around your tomato bed rather than in a single line—this creates a stronger barrier effect.
Nasturtiums take a different approach: they are so attractive to aphids that aphids will feed on them instead of your tomatoes. This is called trap cropping. Plant nasturtiums slightly away from tomatoes, close enough that aphids find them first but far enough that they do not shade the tomato plant. If nasturtiums become heavily infested, you can remove them and plant fresh ones, or straightforward accept the damage as the cost of protecting your tomatoes.
Borage and Other Flowering Plants That Attract Beneficial Insects
Borage flowers attract parasitic wasps and hoverflies, both of which hunt tomato pests. Parasitic wasps lay eggs inside hornworms and aphids, killing them from within. Hoverflies eat aphids and spider mites as both adults and larvae. By planting borage near your tomatoes, you are creating a food source that keeps these predators in your garden.
Other flowering companions that work the same way include alyssum, cilantro (when it bolts and flowers), and dill. These plants are small enough to tuck into corners of your tomato bed or along its edges. They bloom over several weeks, providing a steady supply of pollen and nectar that keeps beneficial insects nearby. Unlike basil, which you harvest for cooking, these plants are grown purely for their pest-control role.
Spacing and Placement for Maximum Effectiveness
The distance between companion plants and your tomato matters because it affects both pest control and plant health. Basil should be close—within 6 to 12 inches of the tomato stem—so its smell is strong enough to confuse pests searching nearby. Marigolds and nasturtiums work better at 12 inches or slightly farther, where they create a visible barrier without competing for water and nutrients.
Taller companions like borage and dill should go on the north side of your tomato bed so they do not shade your plants as they grow. Tomatoes need at least 6 to 8 hours of direct sun daily, and shade from a companion plant can reduce fruit production. If your garden is small, you can plant borage in a pot next to your tomato bed instead of in the ground, giving you control over its size and position.
What Companion Planting Cannot Do Alone
Companion planting reduces pest pressure but does not eliminate it. A severe hornworm or aphid infestation will still damage your tomatoes even with basil and marigolds nearby. In those cases, you will need to remove pests by hand, prune heavily infested leaves, or use other control methods.
Companion plants also do not prevent fungal diseases like early blight or powdery mildew, which spread through water and air rather than by insect choice. Good air circulation, watering at the soil level (not on leaves), and removing lower leaves as the plant grows are still necessary. Think of companion planting as one tool in a toolkit, not a complete solution.
Frequently Asked Questions
Can I plant tomatoes and basil in the same pot?
Yes, if the pot is at least 5 gallons. Basil's roots are shallow and will not compete heavily with tomato roots. Keep the soil consistently moist but not waterlogged, and feed with a balanced fertilizer every two to three weeks since container plants exhaust nutrients faster than garden soil.
Do I need to plant all of these companions, or will one be enough?
One companion plant will help, but a mix is more effective. Basil handles hornworms and whiteflies, marigolds protect roots, and borage brings in predatory insects. Together they cover more pest types than any single plant alone. Start with basil and marigolds if space is limited.
What if I plant companions but still get a lot of pests?
Companion planting works best in gardens where pest pressure is moderate. If you have had severe infestations in past years, you may need to combine companions with other methods: removing affected leaves by hand, improving air circulation, or using row covers on young plants before pests arrive.
Can I eat the companion plants, or are they just for pest control?
Basil, cilantro, and dill are all edible and commonly used in cooking. Marigold petals are edible too, though they have a mild, slightly bitter taste. Borage flowers are edible and taste like cucumber. Nasturtiums are edible as well—both flowers and leaves have a peppery flavor. You can harvest them while they are protecting your tomatoes.
When should I plant companions—at the same time as tomatoes or later?
Plant basil at the same time as tomato transplants or once soil reaches 70°F, since basil is cold-sensitive. Marigolds, nasturtiums, and borage can go in at the same time or a few weeks later. Starting them together gives companions time to establish and begin releasing their protective compounds before pests arrive in mid-summer.