1. Home
  2. Guides
  3. Companion planting
Companion planting · · 9 min read

Companion planting chart for vegetable gardens

Most companion planting charts repeat the same list without saying which parts hold up. This one splits the pairings with a real mechanism — shade, scent masking, nitrogen fixing — from the ones that are tradition.

By the Niwa team — we build the garden planner and grow most of what's described here.

What is companion planting?

Companion planting is the practice of growing different plants near each other to create mutual benefits. It's one of the oldest gardening techniques in the world — and one of the most misunderstood.

Done well, companion planting can: deter pests naturally without chemicals, attract beneficial insects and pollinators, improve soil nitrogen levels, maximize space, and boost flavor or yield of neighboring crops.

Done poorly — or based on folklore rather than evidence — it does nothing, or occasionally causes harm by creating competition for nutrients, water, or light.

The most important rule: Get the basics right first. Sun, soil, water, and spacing matter far more than companion planting. Think of companions as a bonus layer — not a replacement for good growing conditions.

How companion planting actually works

There are four main mechanisms that explain why certain plant pairings work:

1. Pest deterrence through scent

Strongly scented plants like basil, garlic, and marigolds confuse or repel insects that navigate by smell. Aphids and whiteflies, for example, have a much harder time finding tomato plants when basil is planted nearby — the competing scent disrupts their ability to locate their host.

2. Attracting beneficial insects

Flowers like marigolds, nasturtiums, dill, and borage attract predatory insects — ladybugs, lacewings, hoverflies — that eat the pests damaging your crops. They also attract pollinators, which increases fruit set in crops like beans, cucumbers, and tomatoes.

3. Soil improvement through nitrogen fixation

Legumes (beans and peas) have a symbiotic relationship with bacteria in the soil that converts atmospheric nitrogen into a form plants can use. Growing legumes near heavy feeders like corn or brassicas gradually improves soil fertility for the neighboring plants.

4. Physical complementarity

The classic example is the Three Sisters — corn, beans, and squash — grown together by Indigenous farmers across the Americas. Corn provides a pole for beans to climb. Beans fix nitrogen in the soil. Squash shades the ground, retaining moisture and suppressing weeds. Three crops, each making the others more productive.

The 5 companion planting pairs every gardener should know

Tomato + Basil

The most cited companion pair in gardening. Basil is believed to repel thrips, aphids, and whiteflies — all common tomato pests. Some gardeners also report improved tomato flavor near basil, though this is harder to measure scientifically. They also share similar growing conditions: full sun, warm temperatures, consistent water. Easy to plant, easy to harvest together.

Carrot + Onion (or Leek)

Carrot fly and onion fly are both serious garden pests. Carrot fly is deterred by the scent of onions; onion fly is deterred by the scent of carrots. Growing them in alternating rows or in nearby squares confuses both pests. This is one of the more well-supported companion planting combinations in garden research.

Brassicas + Nasturtium

Nasturtiums act as a trap crop for aphids — aphids are so strongly attracted to them that they colonize the nasturtium and leave your cabbage, broccoli, and kale relatively undisturbed. Plant nasturtiums at the edge of your bed or interspersed throughout. As a bonus, nasturtium flowers are edible and add a peppery kick to salads.

Corn + Beans + Squash (Three Sisters)

This combination has been used for thousands of years. Corn provides vertical support for pole beans. Beans fix atmospheric nitrogen and feed the heavy-feeding corn. Squash covers the ground, retaining moisture and preventing weeds from competing. Together, they produce more per square foot than any of the three crops grown separately.

Any vegetable + Marigold

French marigolds (Tagetes patula) are probably the single most useful companion plant in the vegetable garden. They repel nematodes in the soil, deter aphids and whiteflies, and attract beneficial insects. Research has confirmed that marigolds planted near tomatoes and peppers reduce whitefly populations measurably. Plant them throughout your beds, not just at the borders.

Companion planting combinations to avoid

Fennel + Almost everything

Fennel releases allelopathic compounds from its roots that inhibit the germination and growth of most other vegetables. It is particularly harmful to tomatoes, peppers, bush beans, and kohlrabi. Grow fennel in a separate container or in a dedicated bed away from your main vegetable garden. It's one of the few plants that is genuinely bad to have near others.

Onion + Beans or Peas

Onions, garlic, leeks, and other alliums inhibit the growth of beans and peas when planted nearby. The exact mechanism isn't fully understood, but it's one of the most consistently observed incompatible pairings in gardening — keep them well separated in your bed layout.

Brassicas + Tomatoes

Brassicas (cabbage, broccoli, kale, cauliflower) compete heavily with tomatoes for nutrients and are said to inhibit each other's growth. They also attract completely different pest sets, meaning you'd need conflicting deterrent plants nearby. Keep nightshades and brassicas in separate beds where possible.

Mint + Everything (in the ground)

Mint is an aggressive spreader. Left unchecked in a bed, it will colonize every available square foot and crowd out nearby crops. Mint belongs in a container — where it's excellent at deterring aphids and other pests when placed near the bed, without taking over.

The complete companion planting chart

Use this chart as a reference when planning your garden layout. The "good companions" are plants known to benefit each other when grown nearby. The "avoid" column lists combinations that compete or inhibit growth.

Plant Good companions Avoid
TomatoBasil, marigold, carrot, parsley, borageFennel, brassicas, corn
PepperBasil, tomato, carrot, marigoldFennel, kohlrabi
CucumberBeans, peas, radish, marigold, nasturtium, dillSage, potato, aromatic herbs
Zucchini / SquashCorn, beans, nasturtium, boragePotato
CarrotOnion, leek, lettuce, rosemary, sage, tomatoDill (when mature), fennel
LettuceCarrot, radish, strawberry, chives, garlicCelery, parsley
SpinachStrawberry, peas, beans, celeryNone known
Beans (bush)Carrot, cucumber, peas, squash, strawberry, marigoldOnion, garlic, fennel, pepper
PeasCarrot, corn, cucumber, beans, radish, spinachOnion, garlic, leek
Onion / GarlicCarrot, beet, lettuce, chamomile, tomatoBeans, peas, sage
Broccoli / CabbageDill, celery, onion, potato, nasturtium, rosemaryTomato, pepper, strawberry, fennel
KaleBeet, celery, herb, nasturtiumTomato, bean, strawberry
CornBeans, squash, cucumber, sunflower, melonTomato, fennel
RadishCarrot, lettuce, spinach, cucumber, peasHyssop
StrawberryLettuce, spinach, thyme, sage, beansBrassicas, fennel
BasilTomato, pepper, asparagus, oreganoSage, thyme
DillCabbage, lettuce, cucumber, onion, cornCarrot (mature dill), tomato, fennel
MarigoldEverything — plant throughout the bedNothing known
NasturtiumBrassicas, cucumber, squash, tomatoNothing known
FennelGrow alone or with dill onlyAlmost everything

Herbs as companion plants

Herbs are some of the most useful companion plants in the vegetable garden. Most have strong scents that deter pests, and many also attract beneficial insects.

Basil

Plant near tomatoes and peppers. Repels aphids, thrips, and whiteflies. Pinch flowers regularly to keep the plant producing leaves — and to keep pest-deterring volatile compounds at peak concentration.

Rosemary

Strong scent deters cabbage moths, bean beetles, and carrot flies. Plant near brassicas and carrots. Drought tolerant — don't overwater it near crops that need more moisture.

Dill

Attracts predatory insects like wasps and lacewings that eat aphids and caterpillars. Plant near brassicas and cucumbers. Avoid planting near tomatoes or near mature carrots, as it can compete.

Borage

One of the best all-around companion plants. Attracts pollinators and predatory insects. Improves the flavor and growth of strawberries and tomatoes when planted nearby. Edible flowers are a bonus.

Chives

Repel aphids, Japanese beetles, and carrot flies. Plant near roses, carrots, and tomatoes. Easy to grow and mostly perennial — plant once and they return every year.

How to plan companion planting in your garden layout

The most effective way to use companion planting is to integrate it into your garden layout from the start — not as an afterthought after everything is already planted.

When you're mapping your beds, think about which crops you're planting in each square and which companions would help them. A few principles to follow:

  • Scatter marigolds and nasturtiums throughout every bed — they help everything and hurt nothing.
  • Put basil next to (not far from) your tomatoes — proximity matters. Companion benefits fade quickly with distance.
  • Keep fennel completely separate — it's the one plant that genuinely doesn't belong in a mixed bed.
  • Put herbs at the edges of beds — this makes them easy to harvest and positions them to deter pests approaching from outside.
  • Grow mint in containers — place the containers next to beds where you want its deterrent effect, without letting it invade the soil.

See companion planting in your garden plan: Niwa shows you companion planting information for every plant in its library. When you add a plant to your garden layout, you can see which plants are good and bad neighbors — directly in the app. Download free →

What companion planting can't do

Companion planting won't eliminate pests or fix a garden that lacks good soil, sun, or water. It's a supplemental strategy — one layer of a healthy growing system.

Also worth noting: much companion planting advice on the internet is based on folklore rather than controlled research. The pairings in this guide are those with the most consistent evidence behind them, either from scientific studies or from very well-documented gardening practice. When you see claims about exotic companion effects without any explanation of the mechanism — be skeptical.

The basics are real and worth practicing. Marigolds repel nematodes. Nasturtiums trap aphids. Legumes fix nitrogen. Strongly scented herbs deter pest insects. Start there, and build from experience in your own garden.

Plan it in the app instead of on paper.

Niwa lays out the bed, spaces the plants and dates every crop. Free on iPhone.

4.8 13 ratings · iPhone · iOS 18+
FAQ

Questions gardeners ask

Is Niwa free to use?

Yes. Niwa is free to download from the App Store, and the core planner — the garden grid, the plant library and the planting calendar — works without paying. Optional in-app purchases unlock additional features.

See it on the App Store
How many plants fit in one square foot?

It depends on the crop's spacing requirement. A plant needing 3 inches fits 16 per square foot, 4 inches fits 9, 6 inches fits 4, and 12 inches fits 1. Large plants such as vining tomatoes or zucchini need more than one square each. Niwa works this out for you and prints the count straight onto the grid cell.

Plants per square foot calculator
Can Niwa plan a raised bed of any size?

Yes. You set the bed dimensions — 4×4, 4×8, 2×8 or a custom size — and Niwa draws the square foot grid to match. You can keep several beds and several gardens in the app at once and switch between them.

Raised bed planner
How does Niwa know when I should plant?

Niwa uses your location to find your average last spring frost and first autumn frost, then works backwards from those dates for every crop in your bed. Each plant gets its own sow-indoors, transplant and harvest window on a month-by-month timeline, so the dates are yours rather than a generic zone table.

How the planting calendar works
Does Niwa warn me about bad companion plants?

Yes. As you place plants on the grid, Niwa puts a green dot between neighbouring squares that benefit each other and a red dot between squares that are better kept apart, so you see the conflict while you are still planning.

Companion planting in Niwa
How much soil do I need to fill a raised bed?

Multiply length × width × depth in feet to get cubic feet, then divide by 27 for cubic yards. A 4×8 bed at 12 inches deep needs 32 cubic feet, roughly 1.2 cubic yards or sixteen 2-cubic-foot bags.

Raised bed soil calculator
Does Niwa work offline, and do I need an account?

The whole plant library and all your layouts are stored on the device, so the app works with no signal — useful on an allotment. There is no account to create and your garden data is never uploaded to a server.

See what's included
Which growing zones and countries does Niwa support?

Niwa works worldwide. It recognises USDA hardiness zones in the United States and derives frost dates from your location elsewhere, including the UK, Canada, Australia and Europe.

Find your frost dates and zone
How is Niwa different from other garden planner apps?

Three things: it is a native iPhone app rather than a desktop planner viewed in a mobile browser, it shows companion-planting conflicts on the grid as you place plants instead of in a separate chart, and it works fully offline with no account.

Compare Niwa with other planners
Is Niwa available on Android?

Not yet. Niwa is a native iPhone app and needs iOS 18.0 or later. An Android version is not currently available.

Read the gardening guides in the meantime