Yes, onions and tomatoes grow well as neighbors in the garden
Onions and tomatoes can be planted next to each other without harm to either crop. In fact, many gardeners plant them together because they have different root depths and nutrient needs, so they do not compete for the same resources in the soil. Onions are a companion plant for tomatoes — meaning they can improve growing conditions rather than interfere with them.
The main reason this pairing works is that onions stay relatively shallow-rooted while tomatoes develop deeper root systems. Onions typically root 6 to 12 inches deep, while tomato roots extend 18 to 24 inches or more. This means they are drawing water and nutrients from different soil layers. Additionally, onions do not shade tomatoes significantly because they grow upright and narrow, so they will not block sunlight your tomato plants need.
Key Takeaways
- Onions and tomatoes can be planted directly adjacent to each other without competing for water, nutrients, or light.
- Onions have shallow roots while tomatoes root deeply, so they occupy different zones in the soil.
- Space onions 4 to 6 inches apart and tomatoes 24 to 36 inches apart to give each plant room to grow.
- Plant onions in early spring or fall, and time tomato planting so both crops mature without one shading the other excessively.
- Avoid planting beans or peas near onions, as onions can inhibit their growth.
How to space onions and tomatoes in the same bed
When planting onions next to tomatoes, the spacing between plants matters more than the spacing between the two crops. Onions need 4 to 6 inches of space between each bulb, measured from center to center. Tomatoes need 24 to 36 inches depending on the variety — determinate (bush) types need less space, while indeterminate (vining) types need more.
A practical layout is to plant tomatoes in a row with 30 inches between plants, then plant onions in a second row 12 to 18 inches away from the tomato row. This gives onions enough room to develop without being shaded, and keeps them close enough that you can tend both crops together. If you are using a raised bed, you can also plant onions around the base of tomato cages or stakes, since the onions will not interfere with the cage structure.
Do not plant onions directly under tomato branches or in the shadow of a tomato plant once it grows tall. Onions need at least 6 hours of direct sunlight daily, and tomato foliage can reduce that if positioned overhead. Plant onions to the south or east of tomatoes so morning and midday sun reaches them.
Timing your planting so both crops thrive
Onions and tomatoes have different planting windows, so you may need to stagger them slightly. Onions are planted in early spring (as soon as soil is workable, around 2 to 3 weeks before the last frost) or in fall for winter harvest. Tomatoes are planted after the last frost date when soil has warmed to at least 60°F, usually 1 to 2 weeks after onions go in.
This timing actually works in your favor. You can plant onions first, let them establish for a few weeks, then plant tomatoes nearby without disturbing the onion roots. By the time tomatoes are large enough to shade nearby plants, onions are often ready to harvest or have already been pulled. In spring plantings, onions mature in 100 to 120 days while tomatoes take 60 to 85 days from transplant to first fruit, so onions are usually gone before tomatoes reach full size.
If you are growing onions for storage (long-day varieties in northern climates or short-day varieties in southern climates), they will be harvested and out of the bed before tomatoes peak production. This means you can replant the onion space with a fall crop of lettuce or greens once tomatoes are still producing.
What onions add to a tomato bed
Beyond straightforward not interfering, onions offer minor benefits to tomato plants. Onions contain sulfur compounds that some gardeners believe deter certain pests, though the effect is subtle. More importantly, onions do not attract the same pests that target tomatoes — tomato hornworms, spider mites, and early blight fungi do not feed on onions. This means you can use different pest management strategies for each crop without worrying that treating one will harm the other.
Onions also break up soil as they grow, which can improve drainage and aeration around tomato roots. When you harvest onions and pull them from the bed, you are loosening the top layer of soil without disturbing the deeper zones where tomato roots live. This is especially helpful in clay-heavy soil where compaction is a problem.
Plants to avoid planting near onions
While onions pair well with tomatoes, they do not pair well with all garden plants. Onions inhibit the growth of beans and peas — the sulfur compounds that may help tomatoes actually suppress nitrogen-fixing bacteria that beans and peas rely on. Do not plant these legumes within 2 feet of an onion row.
Onions also compete with asparagus for nutrients and can reduce asparagus yields if planted too close. Keep onions at least 3 feet away from asparagus beds. Garlic and other alliums (the onion family) should not be planted in the same spot year after year, as they deplete certain soil nutrients and can build up disease pressure, so rotate them to a different bed each season.
Common mistakes when planting onions and tomatoes together
The most frequent error is planting onions too close to tomato stems. Gardeners often assume that since the plants are compatible, they can be planted touching each other. In reality, onions need their own space to develop full bulbs, and tomato stems need air circulation to prevent fungal disease. Even though the roots do not compete, the above-ground parts do need room.
Another mistake is planting onions in the shade of mature tomato plants. If you plant onions in late spring after tomatoes are already tall, the tomato foliage will shade the onions and stunt their growth. Plant onions early in the season, or choose a spot that gets direct sun even after tomatoes are full-sized.
A third error is forgetting that onions and tomatoes have different water needs. Tomatoes prefer consistent moisture but not waterlogged soil, while onions prefer drier conditions once they are established. If you water heavily for tomatoes, onions may rot. Use drip irrigation or soaker hoses so you can water the tomato base without soaking the onion area, or mulch onions lightly to help them shed excess moisture.
Soil preparation for both crops
Both onions and tomatoes benefit from rich, well-draining soil, so you can prepare the bed the same way for both. Work 2 to 3 inches of compost or aged manure into the top 8 to 10 inches of soil before planting. This improves drainage and adds nutrients that both crops need.
Tomatoes are heavy feeders and benefit from extra nitrogen early in the season, so you can add a balanced fertilizer (such as 10-10-10) or a tomato-specific formula when you plant. Onions need less nitrogen but benefit from phosphorus and potassium, which support bulb development. If you are using a single fertilizer for the bed, a balanced formula works for both, though you can side-dress tomatoes with extra nitrogen mid-season if growth slows.
Check your soil pH before planting. Both onions and tomatoes prefer slightly acidic to neutral soil, between 6.0 and 7.0. If your soil is too acidic, add lime; if it is too alkaline, add sulfur. A soil test from your local extension office will tell you exactly what your soil needs.
Frequently Asked Questions
Do onions repel pests that attack tomatoes?
Onions do not actively repel tomato pests, but they do not attract them either. The sulfur compounds in onions may have a mild deterrent effect on some insects, but this is not strong enough to rely on as pest control. Plant onions near tomatoes for spacing efficiency, not for pest management.
Can I plant onions after I harvest tomatoes in the same spot?
Yes, you can plant onions in a tomato bed after harvest, especially in fall. Clear away tomato debris, work in fresh compost, and plant onion sets or seeds 4 to 6 weeks before your first expected frost. This gives onions time to establish roots before winter dormancy.
What if my tomato plant gets very large and shades the onions?
Prune lower tomato branches to increase air circulation and light penetration to the onion area. Remove only the lowest 6 to 12 inches of foliage once the plant is established — this does not harm the tomato and lets more sun reach nearby plants. Avoid heavy pruning during fruit production.
How close can I plant onion sets to tomato transplants?
Plant onion sets at least 12 inches away from tomato stems, measured from the center of each plant. This gives onions room to develop their bulbs and tomatoes room for air circulation. If space is tight, plant onions 18 inches away to be safe.
Do I need to fertilize onions and tomatoes differently if they are in the same bed?
A balanced fertilizer works for both crops, but you can adjust if needed. Tomatoes benefit from extra nitrogen in early growth, while onions benefit from phosphorus and potassium for bulb development. If you side-dress tomatoes with nitrogen, explore it only to the tomato base so onions do not receive excess nitrogen, which delays bulb formation.