Onions and tomatoes are good companion plants, but with limits

Yes, onions and tomatoes can grow in the same bed, and they do help each other in some ways. Onions repel certain pests that attack tomatoes—particularly spider mites and aphids—because of their strong sulfur compounds. Tomatoes, in turn, don't compete heavily with onions for nutrients or space if you plant them correctly. However, they are not an ideal pairing. Both plants prefer similar watering schedules, which can lead to problems if one needs more water than the other at a critical moment. The real issue is that onions mature and are harvested much earlier than tomatoes, leaving a gap in your bed that invites weeds and pests.

The success of growing them together depends mostly on how you space them, how you water them, and what you plant in the space once the onions come out. With attention to these details, you can make the pairing work in a small garden.

Key Takeaways

  • Onions release sulfur compounds that repel spider mites and aphids, two common tomato pests, making them a useful neighbor in the garden bed.
  • Both plants need consistent moisture but at different rates—onions prefer drier soil once established, while tomatoes need steady water—so monitor each plant separately.
  • Onions are ready to harvest 60 to 120 days after planting, while tomatoes fruit for months, so your bed will be half-empty for weeks once onions come out.
  • Plant onions on the outer edge of your tomato bed rather than directly underneath, so harvesting onions doesn't disturb tomato roots.
  • If space is tight, succession planting a second crop of onions or a fast-growing green like lettuce after the first onions come out keeps the bed productive.

How onions protect tomatoes from pests

Onions contain sulfur compounds that become stronger when the plant is damaged or crushed. These compounds create a smell that repels spider mites, which are among the most damaging pests for tomatoes in warm weather. Spider mites feed on leaf undersides and can strip a tomato plant bare in weeks if left unchecked. Onions also deter aphids, which cluster on new growth and transmit viruses between plants.

The protection is not complete—onions won't eliminate these pests entirely—but they reduce the population enough to make a real difference, especially early in the season when pest pressure is building. This is why onions are listed as a companion plant for tomatoes in most garden guides. The effect is strongest when onions are planted close enough to tomatoes that their smell reaches the tomato foliage, typically within 12 to 18 inches. If you space them farther apart, the pest-repelling benefit drops significantly.

Watering and soil needs create tension

Both onions and tomatoes like rich, well-draining soil and need regular water, but their timing and amounts differ. Onions need consistent moisture while they are growing their bulbs—roughly the first 60 to 90 days—but once the bulb begins to swell, they prefer the soil to dry out between waterings. Tomatoes, by contrast, need steady moisture throughout the season, especially once flowering and fruiting begin. If you water heavily for the tomatoes, onion bulbs may split or rot. If you hold back water for the onions, tomatoes may develop blossom-end rot or drop fruit.

The best approach is to plant onions where you can water them separately or to use drip irrigation with separate lines for each plant. If you are hand-watering, check the soil around each plant individually before watering rather than watering the whole bed at once. This takes more attention but prevents the mismatch that makes companion planting fail. A soaker hose with a timer on each section of the bed works well if you have the setup available.

Timing and spacing matter more than you might think

Onions mature in 60 to 120 days depending on the variety and your climate. Tomatoes don't produce fruit until 60 to 85 days after transplanting and then fruit for 8 to 12 weeks or until frost. This means your onions will be ready to harvest while your tomatoes are still flowering or just beginning to ripen. Once you pull the onions, you have a bare patch of soil in the middle of your tomato bed for the rest of the season.

Plant onions around the perimeter of your tomato bed rather than directly underneath the tomato plants. This keeps the onion harvest from disturbing tomato roots and makes it easier to pull onions without accidentally damaging nearby tomato stems. Space onions 4 to 6 inches apart and tomatoes 24 to 36 inches apart, depending on the variety. If you are growing determinate (bush) tomatoes, you have more room for onions around the edges. For indeterminate (vining) tomatoes, keep onions at least 18 inches away from the main stem so you have room to stake or cage the plant.

What to plant after onions come out

Once you harvest onions in mid-to-late summer, you have two choices: leave the space empty and mulch it to suppress weeds, or plant a fast-growing crop that will mature before frost. Lettuce, spinach, arugula, and other leafy greens can be succession-planted in the space where onions were. These crops grow quickly (30 to 50 days) and won't compete with tomatoes for nutrients because they are shallow-rooted. Avoid planting another heavy feeder like beans or squash, which will pull nitrogen away from your tomatoes during their peak fruiting period.

If you live in a warm climate with a long growing season, you can plant a second crop of onions in the same space. This works best if you use sets (small bulbs) rather than seeds, since sets mature faster. Plant them as soon as the first crop comes out, and they will be ready to harvest before the first frost. Green onions (scallions) are an even faster option—they mature in 30 to 60 days and can be harvested continuously by cutting outer leaves rather than pulling the whole plant.

Better companion plants if space is limited

If you have only a small bed and are concerned about the watering mismatch or the gap left by early-harvesting onions, consider other tomato companions instead. Basil repels flies and hornworms and actually improves tomato flavor. Carrots are shallow-rooted and won't compete with tomatoes for deep nutrients. Marigolds attract beneficial insects and repel some beetles. Parsley and cilantro are also shallow-rooted and can be harvested continuously without leaving a gap.

Garlic is another allium (like onions) and offers the same pest-repelling benefits, but it is planted in fall and harvested in early summer, so the timing gap is even larger. If you do grow garlic with tomatoes, plan to succession-plant something else when ready after harvest. For most home gardeners with limited space, basil or carrots are simpler choices because they don't create the watering conflict that onions do.

Plants to keep away from tomatoes

Some plants actively harm tomatoes and should not be planted nearby. Brassicas (cabbage, broccoli, kale) compete for the same nutrients and attract pests that also feed on tomatoes. Fennel and dill release compounds that inhibit tomato growth. Potatoes are in the same family as tomatoes and share many of the same diseases, so planting them together increases the risk of early blight or late blight spreading between crops.

Corn and tomatoes both attract hornworms, so growing them together concentrates the pest problem. Walnut trees release a chemical called juglone that is toxic to tomatoes and many other plants, so keep tomato beds at least 50 feet away from any walnut tree. Avoid planting tomatoes where you grew potatoes, peppers, or eggplants the previous year, since these crops share diseases that can survive in the soil.

Frequently Asked Questions

Can I plant onion sets directly in the tomato bed in spring?

Yes. Plant onion sets 4 to 6 inches apart around the edge of your tomato bed after the last frost, when soil is workable. They will sprout within a week and won't interfere with tomato transplants if you space them far enough apart. Water them separately from tomatoes for the first month.

Will onions growing under tomatoes shade them too much?

No. Onions stay low to the ground and don't grow tall enough to shade tomato foliage. However, avoid planting onions directly under tomato plants because harvesting them will disturb the tomato roots. Plant onions on the outer edge instead.

What if my tomatoes and onions both need water at the same time?

Water both, but check the soil moisture separately first. Onions need less water than tomatoes once they begin bulbing. If soil around onions feels moist 2 inches down, skip watering them and water only the tomatoes. Use a soaker hose or drip line if possible so each plant gets what it needs.

Can I grow green onions (scallions) with tomatoes instead of bulbing onions?

Yes, and scallions are actually a better choice for small spaces. They mature in 30 to 60 days, so the timing gap is shorter, and you can harvest them continuously by cutting outer leaves rather than pulling the whole plant. Plant them around the tomato bed edge and succession-plant new crops every two weeks for continuous harvest.

Do I need to fertilize onions and tomatoes differently if they are in the same bed?

Tomatoes are heavy feeders and need more nitrogen early and more phosphorus once flowering begins. Onions need moderate nitrogen and potassium but less phosphorus. If you are using a balanced fertilizer, explore it according to the tomato schedule and reduce the amount slightly if onions show signs of excess nitrogen (very tall, soft leaves). Once onions are harvested, increase fertilizer for the tomatoes.