Affiliate Disclosure: This article contains affiliate links. If you purchase through these links, we may earn a commission at no extra cost to you. We only recommend products we genuinely believe in. Full disclosure.

Your garden has chemistry. Some plants make each other stronger. They repel each other's pests, share nutrients through the soil, attract pollinators, and provide shade exactly where it is needed. Other plants are quietly sabotaging their neighbors, releasing chemicals that stunt growth or competing for the same resources until both lose. Companion planting is the practice of putting the right plants next to each other and keeping the wrong ones apart.

This companion planting guide for vegetables covers the ten best pairings, the combinations you need to avoid, and the herbs that double as bodyguards for your crops. Whether you grow in a backyard plot, a raised bed, or a few containers on your balcony, these pairings will help you grow more food with fewer problems.

3
Sisters (oldest pairing system)
10+
Proven companion pairings
5
Plants to keep separated
30%+
Possible yield boost

Key Takeaways

  • Companion planting pairs vegetables, herbs, and flowers so they help each other grow through pest control, nutrient sharing, pollination, and shade
  • Tomatoes + basil is the gold standard pairing: basil repels pests and may improve tomato flavor
  • The Three Sisters method (corn, beans, squash) is the oldest known companion planting system and still one of the most effective
  • Marigolds are the universal companion plant, repelling nematodes and aphids around almost any vegetable
  • Keep fennel away from everything. It releases growth-inhibiting chemicals that harm most nearby plants
  • Companion planting works in raised beds and containers, not just large gardens

What Is Companion Planting (and Does It Actually Work?)

Companion planting is growing different plants together so they support each other. The idea is ancient. Indigenous peoples across the Americas planted corn, beans, and squash together thousands of years before anyone wrote a gardening book. They did it because it worked. The corn gave the beans something to climb. The beans fixed nitrogen in the soil to feed the corn. The squash spread across the ground and shaded out weeds. Three plants, each solving a problem for the others.

Modern gardeners sometimes dismiss companion planting as folklore. And yes, some of the old claims are more tradition than science. But research keeps catching up. Studies on intercropping (growing different species together rather than in monoculture rows) consistently show yield improvements of 30% or more. The mechanisms are real, measurable, and increasingly well understood.

The short answer: companion planting works. Not every pairing is magic, but the ones backed by evidence can meaningfully improve your harvest, reduce pest pressure, and make your garden more resilient. Here is why.

The Science Behind It

Companion planting is not guesswork. Four distinct mechanisms explain why certain plants help (or hurt) each other.

Pest confusion

Many garden pests find their target plants by smell. A cabbage moth homes in on the scent of brassicas. An onion fly tracks the sulfur compounds of alliums. When you mix different plants together, the scent signals get scrambled. A pest flying over a diverse garden has a much harder time zeroing in on its target than one flying over a clean monoculture row. This is why planting aromatic herbs among your vegetables reduces pest damage without a single spray.

Nitrogen fixing

Legumes (beans, peas, clover) form a partnership with bacteria in their root nodules that converts atmospheric nitrogen into a form plants can use. When you grow a legume next to a nitrogen-hungry crop like corn or leafy greens, some of that fixed nitrogen becomes available to the neighbor. It is free fertilizer, manufactured in the soil by biology.

Allelopathy

Some plants release chemicals from their roots, leaves, or decaying matter that suppress the growth of other plants nearby. Fennel is the textbook example. It releases compounds that inhibit most vegetables. Black walnut trees do the same thing with a chemical called juglone. Understanding allelopathy helps you avoid planting combinations that will quietly sabotage your harvest.

Trap cropping

A trap crop is a plant you grow specifically to attract pests away from your main vegetables. Nasturtiums are a perfect example. Aphids love nasturtiums even more than they love your kale. Plant nasturtiums along the border of your bed, and they draw aphids to themselves, keeping your vegetables clean. You sacrifice a few flowers to protect your food. It is a trade worth making every time.

Worth knowing: These four mechanisms often overlap. Marigolds work through pest confusion (strong scent), allelopathy (they release nematode-suppressing compounds into the soil), and trap cropping (they attract whiteflies away from tomatoes). One plant, three layers of protection.

The 10 Best Companion Planting Combinations

These are the pairings with the strongest track record. Each one is backed by gardening tradition, practical experience, or scientific research. Many hit all three.

Plant A Plant B Why It Works
Tomatoes Basil Basil repels thrips and mosquitoes, may improve tomato flavor
Carrots Onions Onions repel carrot fly; carrots repel onion fly
Corn Beans Beans fix nitrogen; corn provides climbing support
Squash Corn + Beans Squash shades soil, suppresses weeds (Three Sisters)
Peas Carrots Peas fix nitrogen; carrots thrive in cool, loose soil
Lettuce Tall crops (corn, tomatoes) Lettuce benefits from afternoon shade in hot weather
Tomatoes Borage Borage attracts pollinators and adds trace minerals to soil
Cabbage Rosemary Rosemary repels cabbage moths with its strong scent
Any vegetable Marigolds Marigolds repel nematodes, aphids, and whiteflies
Strawberries Borage Borage attracts pollinators, improves strawberry yield

Let's dig into the standout pairings.

Tomatoes + basil

This is the pairing everyone starts with, and for good reason. Basil's strong aromatic oils repel thrips, mosquitoes, and aphids. Some gardeners and researchers believe basil improves the flavor of tomatoes grown nearby, though the evidence on that is more anecdotal than scientific. What is not debatable: both plants thrive in the same conditions (full sun, warm soil, consistent water), and you will use them together in the kitchen. Plant basil around the base of your tomato plants, about 12 inches apart. Use quality herb seeds to get a strong, aromatic variety.

Carrots + onions

This is one of the most elegant companion pairs. Carrot fly finds carrots by smell. Onion fly finds onions by smell. When you grow them side by side, each plant's scent masks the other from its specific pest. Interplant rows of carrots and onions in alternating strips. Neither needs much space, and both produce underground, so they do not compete for light or air above ground.

Peas + carrots

Not just a frozen bag from the grocery store. Peas fix nitrogen in the soil through their root nodules, and carrots benefit from that extra nitrogen. Peas grow vertically and cast minimal shade, so carrots still get the light they need. Plant peas on a trellis and sow carrots at their feet. As the peas finish producing, cut them at the base and leave the roots in the soil. The nitrogen stays behind and feeds whatever you plant next.

Lettuce + tall crops

Lettuce bolts (goes to seed and turns bitter) when it gets too hot. Planting lettuce on the east or north side of tall crops like corn, tomatoes, or sunflowers gives it natural afternoon shade. The lettuce stays cooler, produces longer, and tastes better. You get a second harvest from the same bed space.

Plants That Should Never Be Neighbors

Bad pairings can do more damage than good pairings can help. These combinations create problems ranging from stunted growth to shared diseases to complete crop failure.

Keep Apart Keep Apart Why
Fennel Almost everything Fennel releases growth-inhibiting chemicals from its roots
Tomatoes Potatoes Both are nightshades; they share blight and attract the same pests
Beans Onions / Garlic Alliums stunt the growth of legumes and inhibit nitrogen fixing
Dill Carrots Both are in the same family and can cross-pollinate, affecting seed quality
Brassicas Strawberries Brassicas are heavy feeders that compete aggressively for nutrients

Fennel: the garden loner

Fennel deserves special attention because it is the most antisocial plant in the vegetable garden. It releases allelochemicals from its root system that suppress the growth of tomatoes, beans, peppers, and most other common vegetables. Fennel is worth growing for its flavor and its ability to attract beneficial insects, but give it its own container or a spot at least 3-4 feet from everything else. Treat it like the introvert who needs personal space.

Tomatoes and potatoes

Both belong to the nightshade family. They share the same diseases, especially late blight, which can wipe out both crops simultaneously. They also attract the same pests, particularly the Colorado potato beetle. Grow them on opposite sides of your garden, and ideally rotate where you plant nightshades each year so diseases do not build up in the soil.

Beans and alliums

Onions, garlic, leeks, and shallots all release sulfur compounds that interfere with the nitrogen-fixing bacteria in bean and pea roots. The result: your legumes fix less nitrogen, grow more slowly, and produce fewer pods. Keep alliums and legumes in separate beds.

Pro tip: When planning your garden layout, it is easier to start with the "never pair" list than the "always pair" list. Avoid the bad combinations first, then fill in with beneficial pairings. You will prevent more problems than you create.

Herbs That Protect Your Vegetables

Herbs are the unsung heroes of companion planting. Their strong scents confuse pests, their flowers attract beneficial insects, and many of them improve the health and flavor of nearby vegetables. A border of herbs around your vegetable beds is one of the best investments you can make. Grab a herb seed variety pack and scatter them throughout your garden.

Basil

Repels thrips, mosquitoes, and aphids. Plant near tomatoes, peppers, and asparagus. The stronger the scent, the better the protection.

Rosemary

Repels cabbage moths, carrot fly, and bean beetles. Plant near brassicas (cabbage, broccoli, kale) and carrots. Its woody scent is a powerful pest deterrent.

Dill

Attracts beneficial wasps that prey on caterpillars and aphids. Great near lettuce and cucumbers, but keep it far from carrots to avoid cross-pollination.

Cilantro

Repels aphids and attracts hoverflies (whose larvae eat aphids). Let some plants flower for maximum benefit. Plant near tomatoes and leafy greens.

Sage

Repels cabbage moths and carrot fly. Its strong aroma masks the scent of nearby vegetables. Plant near brassicas and root vegetables.

Mint

Repels ants, aphids, and flea beetles. Always grow in a pot because it spreads aggressively. Place potted mint near doorways to your garden beds.

Two flowers deserve honorary herb status in the companion planting world.

Marigolds: the universal companion

Marigolds are the most versatile companion plant in existence. French marigolds release a chemical called alpha-terthienyl from their roots that kills root-knot nematodes in the soil. They also repel aphids and whiteflies with their pungent scent. Plant marigolds as a border around any vegetable bed, or tuck them between rows. They work with tomatoes, peppers, beans, squash, cucumbers, and pretty much everything else. As a bonus, they attract pollinators and look great.

Nasturtiums: the sacrificial bodyguard

Nasturtiums are a trap crop. Aphids find them irresistible. Plant nasturtiums along the edges of your garden, and they will draw aphids away from your vegetables. You will see the nasturtiums covered in aphids while your kale and beans stay clean. The flowers are edible too, with a peppery kick that works well in salads. Let them do their job and replace them when they get too infested.

The Three Sisters Method

The Three Sisters is the oldest documented companion planting system. It originated with Indigenous peoples of North America, who grew corn, beans, and squash together in the same mound. Each plant serves a specific role, and together they create a self-sustaining growing system that needs less water, less weeding, and no fertilizer.

How to plant the Three Sisters

  1. Create a mound of soil about 12 inches high and 18 inches across. Space mounds 4-5 feet apart.
  2. Plant 4-6 corn seeds in the center of each mound. Wait until they reach about 6 inches tall.
  3. Plant 4 bean seeds around the base of the corn, about 6 inches out from the stalks.
  4. Plant 2-3 squash seeds at the edge of each mound. Winter squash varieties with large leaves work best.
  5. As the plants grow, gently guide the bean vines toward the corn stalks. The squash will spread outward on its own.

The Three Sisters work best with traditional varieties. Heirloom seed varieties give you the tall corn, vigorous climbing beans, and spreading squash that make this system sing. Modern dwarf varieties do not have the height or growth habit to play their roles properly.

Pro tip: Plant the corn first and let it establish before adding beans and squash. If you plant everything at once, the fast-growing beans and squash can overwhelm the corn before it gets tall enough to serve as a trellis.

How to Plan Your Companion Planting Layout

A companion planting plan does not need to be complicated. Start with what you actually want to eat, then arrange your plants using these principles.

Step 1: Pick your core crops

Choose the 5-8 vegetables you eat most. Tomatoes, peppers, lettuce, carrots, beans, and squash are common starting points. These are your main characters. Everything else plays a supporting role.

Step 2: Check the "avoid" list first

Before you plan any pairings, make sure none of your core crops are on each other's bad list. Separate tomatoes from potatoes. Keep beans away from onions and garlic. Give fennel its own space. Getting this right prevents problems before they start.

Step 3: Assign companions

Match each core crop with at least one beneficial companion. Plant basil with your tomatoes. Put onions next to your carrots. Border your beds with marigolds. Tuck nasturtiums along the edges as trap crops. Use the comparison table above as your reference.

Step 4: Add herb borders

Ring each bed or section with aromatic herbs. Rosemary near your brassicas, cilantro near your tomatoes, dill near your cucumbers. The herbs serve double duty: pest protection for your vegetables and fresh ingredients for your kitchen. Use plant markers to keep track of what is planted where, especially when you have a dense mix of companions.

Step 5: Think vertically

Tall crops on the north side of your garden, short crops on the south. This ensures everything gets enough sunlight. Plant lettuce and spinach where they will catch afternoon shade from taller neighbors. Train beans and peas vertically on trellises to free up ground space for sprawling companions like squash.

Companion Planting in Containers and Raised Beds

You do not need a large plot to use companion planting. These pairings work just as well in containers on a balcony or in a compact raised bed.

Container pairings that work

The key in containers is matching plants that share the same water and light needs. Tomatoes and basil both want full sun and consistent moisture. Lettuce and chives both tolerate partial shade. Do not pair a drought-loving herb like rosemary with a water-hungry vegetable like cucumber in the same pot.

Raised bed layout

A standard 4x8 foot raised bed gives you enough room for a full companion planting arrangement. Try this layout:

Fill your raised bed with quality garden soil and compost mix. Healthy soil makes companion planting even more effective because the plants have the nutrients they need to produce the aromatic oils and compounds that drive pest repulsion.

Raised Garden Bed Kit

Cedar or composite construction | 4x8 ft | Easy assembly | Ideal for companion planting layouts

A raised bed gives you complete control over soil quality and makes companion planting layout straightforward. Cedar beds last 10-15 years, resist rot naturally, and do not leach chemicals into your soil. A 4x8 foot bed provides enough space for 3-4 crop rows with herb borders.

Pros

  • Perfect size for companion planting arrangements
  • Better drainage and soil control
  • Easier on your back (no bending to ground level)
  • Warms up faster in spring for earlier planting
  • Keeps sprawling plants contained

Cons

  • Upfront cost for materials
  • Needs filling with quality soil
  • Dries out faster than in-ground beds in hot weather
Check Raised Bed Kits

Heirloom Seed Collection

Non-GMO | Open-pollinated | Includes 20+ vegetable varieties | Perfect for companion planting

Heirloom seeds give you the genetic diversity that makes companion planting most effective. Open-pollinated varieties produce plants with stronger scent profiles and natural pest resistance compared to many hybrid seeds. Plus, you can save seeds from year to year, making your garden more self-sufficient over time.

Pros

  • Wide variety of vegetables in one pack
  • Open-pollinated for seed saving
  • Stronger natural pest resistance
  • Great flavor and diversity

Cons

  • Some varieties need longer growing seasons
  • Less uniform appearance than hybrid seeds
Browse Heirloom Seeds

Garden Plant Markers

Weatherproof | Reusable | Essential for tracking companion planting layouts

When you are growing 10+ species in one bed, labels keep you sane. Mark each row and companion grouping so you know what is planted where. Especially helpful in dense companion planting layouts where seedlings can look similar in the early weeks.

Pros

  • Prevents planting confusion in dense gardens
  • Reusable season after season
  • Helps with garden journaling and rotation planning

Cons

  • Cheap plastic ones fade in UV light
  • Metal or slate markers cost more
Check Garden Markers

For natural pest management beyond companion planting, read our guide on organic pest control for your vegetable garden. The two strategies complement each other perfectly.

Ready to Start Growing?

Whether you are building your first raised bed or rethinking your existing garden layout, companion planting helps you grow more food in less space with fewer problems. Start with one or two pairings and expand from there.

Read: Build a Raised Bed on a Budget
Read: Container Gardening for Apartments

Frequently Asked Questions

Companion planting is backed by real science. Pest confusion, nitrogen fixation, allelopathy, and trap cropping are all documented mechanisms. Studies show that intercropping can boost yields by 30% or more compared to monocultures. Some traditional pairings like tomatoes and basil have been validated in controlled research. Not every folk claim holds up, but the core principles are solid and measurable.

Tomatoes and basil. Plant basil around the base of your tomato plants, about 12 inches apart. Basil repels thrips and mosquitoes, and many gardeners report improved tomato flavor. Both plants enjoy the same growing conditions: full sun, consistent moisture, and warm soil. It is the simplest pairing to try because both are easy to grow and you will use them together in the kitchen anyway.

Absolutely. Companion planting works in any growing setup. In containers, pair a tall plant with a trailing or low-growing companion in the same pot, like tomatoes with basil or peppers with marigolds. In raised beds, you have even more flexibility to arrange plants in beneficial groupings. The same pairing principles apply regardless of whether you grow in the ground, in a raised bed, or in a container on your balcony.

Fennel releases chemicals from its roots that inhibit the growth of most nearby plants. This process is called allelopathy. Tomatoes, beans, peppers, and most other common vegetables grow poorly when planted near fennel. The safest approach is to give fennel its own dedicated pot or a corner of the garden at least 3-4 feet from everything else. It is a great herb to grow, just not a team player.

For pest-repelling companions like basil, marigolds, or onions, plant them within 12 to 18 inches of the crop you want to protect. For nitrogen-fixing companions like peas and beans, interplanting within the same row or adjacent rows works best so the nitrogen reaches nearby roots. For trap crops like nasturtiums, plant them along the border of your garden bed so they intercept pests before they reach your vegetables.