Tomatoes and onions are good companion plants, but with limits
Yes, tomatoes and onions grow well together in the same bed or garden space. Onions do not compete heavily with tomatoes for nutrients or water, and they occupy different soil depths — onion roots stay shallow while tomato roots go deep. The real benefit is practical: onions repel some common tomato pests, including spider mites and aphids, which means fewer insects damaging your fruit.
The pairing works best when onions are planted around the edges of tomato plants or in alternating rows, rather than crowded directly against the stem. This spacing gives both plants room to grow and makes harvesting easier. Onions mature in 90 to 120 days depending on variety, while tomatoes fruit over a longer season, so you can pull onions before they shade the tomato foliage.
One real constraint: if you use the same bed year after year, both plants are susceptible to fusarium wilt and other soil-borne diseases. Rotating your beds every two to three years prevents buildup of these pathogens, whether you plant tomatoes with onions or alone.
Key Takeaways
- Onions repel spider mites and aphids, two pests that commonly damage tomato plants and fruit.
- Onion roots stay shallow while tomato roots reach deep, so they do not compete for water or nutrients in the same soil layer.
- Plant onions around the edges of tomato plants or in separate rows to avoid shading and allow room for both to mature.
- Onions mature and can be harvested before tomatoes finish fruiting, freeing up space in the bed if you need it.
- Rotate your beds every two to three years to prevent fusarium wilt and other diseases that affect both crops.
How onions protect tomatoes from pests
Onions contain sulfur compounds that repel spider mites and aphids — two insects that feed on tomato leaves and stems and can reduce yield or spread disease. The smell and taste of the onion plant itself deter these pests from settling nearby. This is not a may provide that your tomatoes will never see an aphid, but the presence of onions measurably reduces the population.
Onions do not repel all tomato pests. Hornworms, whiteflies, and early blight fungus are not deterred by onion proximity. If these become a problem in your garden, you will need to address them separately through pruning, netting, or fungicide spray — companion planting alone will not solve it.
The pest-repelling effect works best when onions are actively growing and their foliage is healthy. A stressed or dying onion plant offers little protection, so water and fertilize both crops evenly.
Root depth and nutrient competition
Tomato roots extend 12 to 18 inches deep into the soil, drawing water and nutrients from the lower layers. Onion roots stay in the top 6 to 8 inches, feeding from the surface layer. Because they feed at different depths, they do not compete for the same resources — a tomato plant and an onion plant in the same bed can both get what they need.
This difference in root depth is why onions work as companions not only for tomatoes but also for peppers, carrots, and other crops with deeper root systems. It is also why onions and shallow-rooted plants like lettuce or spinach can crowd each other out if planted too close.
Soil quality still matters. Both plants benefit from compost or aged manure worked into the bed before planting. If your soil is poor, adding nutrients helps both crops, but the onion will not starve the tomato or vice versa.
Spacing and planting layout
Plant onion sets or seedlings 4 to 6 inches apart in rows around the perimeter of your tomato bed, or in alternating rows if you have space. Do not plant onions directly against the tomato stem — leave at least 12 inches between the center of the tomato plant and the nearest onion. This spacing prevents the onion foliage from shading the tomato leaves as both plants grow.
If you are using a raised bed or container, onions can go in the corners or along the edges while tomatoes occupy the center. In a traditional in-ground garden, a common layout is tomatoes in the middle with onions in a ring around them, or tomatoes and onions in alternating rows with 18 to 24 inches between rows.
Avoid planting onions so densely that they create a solid mat of foliage. Crowding reduces air circulation, which can trap moisture and encourage fungal disease on both plants. Thin seedlings if they come up too close together.
Timing and harvest windows
Onions mature in 90 to 120 days from planting, depending on the variety and your climate. Tomatoes typically start producing fruit 60 to 80 days after transplanting but continue fruiting until frost or disease stops them — often 3 to 4 months or longer. This means you can harvest onions while tomatoes are still in the middle of their season.
Once you pull the onions, the space they occupied opens up. You can leave the bed as is, or use the freed space to add a second crop of a fast-growing plant like basil or lettuce if your growing season is long enough. The tomato plants will have more room and better air circulation once the onions are gone.
If you are growing storage onions (varieties meant to keep for months), harvest them when the tops fall over and start to dry. Bunching onions and scallions can be pulled earlier, as soon as they reach usable size. Check the seed packet or plant label for the expected days to maturity for your specific variety.
Diseases that affect both crops
Fusarium wilt, a soil-borne fungal disease, affects both tomatoes and onions. If you grow them in the same bed year after year without rotating, the fungus builds up in the soil and can devastate both crops. Crop rotation — moving tomatoes and onions to a different bed every two to three years — is the most reliable way to prevent this.
Botrytis (gray mold) and powdery mildew can also affect both plants, especially in humid conditions or when foliage stays wet. Water at the base of the plants rather than overhead, and space them far enough apart for air to flow between them. Remove any diseased leaves promptly and dispose of them in the trash, not the compost pile.
If disease appears in your tomato or onion bed, do not assume the companion planting failed. Disease is usually a sign of poor spacing, overwatering, or soil that has not been rotated. Adjust these factors and the pairing will work better in future seasons.
Other plants that work well with tomatoes
Basil is the most famous tomato companion — it repels flies and mosquitoes, and its flavor complements tomato dishes. Plant basil around tomato plants or in nearby containers. Carrots, marigolds, and nasturtiums also pair well with tomatoes and offer pest control or visual appeal.
Garlic works similarly to onions: it repels spider mites and aphids and does not compete for nutrients. If you prefer garlic to onions, or want to grow both, garlic is a solid alternative or addition to your tomato bed.
Avoid planting tomatoes near brassicas (cabbage, broccoli, kale) or fennel, which can inhibit tomato growth. Potatoes are also poor companions because they share pests and diseases with tomatoes.
Frequently Asked Questions
Do I have to plant onions with tomatoes, or is it optional?
It is optional. Tomatoes grow fine alone, and companion planting is a way to reduce pest pressure and make better use of space — not a requirement. If you prefer to grow only tomatoes, or if space is limited, skip the onions. Pest management through other methods (pruning, netting, or spray) will work.
Can I plant tomatoes and onions in a container together?
Yes, if the container is large enough. A 5-gallon pot can hold one tomato plant and 2 to 3 onion sets planted around the edge. Use quality potting soil, water regularly (containers dry out faster than garden beds), and may support the pot has drainage holes. Tomatoes in containers need support, so use a cage or stake.
What if I plant onions too close to tomatoes?
Crowded onions will shade the tomato foliage and reduce air circulation, which can slow tomato growth and increase disease risk. The tomato may still produce, but yield will be lower. If you realize they are too close after planting, thin the onions or move some to another spot.
Can I use onion scraps or kitchen onions to plant?
Kitchen onions are usually treated to prevent sprouting, so they rarely grow. Use onion sets (small bulbs) or seedlings from a garden center or seed supplier. Sets are the easiest option for beginners and are inexpensive.
Will onions attract pests to my tomatoes instead of repelling them?
No. Onions repel the pests that commonly damage tomatoes. They do not attract new pests or make your tomato bed a target. Some insects may still visit, but the overall pest pressure is lower when onions are present.