Companion planting is the opposite of monoculture, where one crop plant is planted in one area.
In companion planting different species of plants are grown together in close vicinity so that both species can influence each other. The idea is that one type of plant can have beneficial effects on the other. The nature of these effects varies greatly. Some basic effects are improving growth rate, for instance by fixing nitrogen, enhancing the flavour or taste, deterring pests through chemicals, and attracting beneficial insects, pollinators and natural enemies to pests.
In addition to the companion plant with a measurable effect I would like to add another category of companion planting: the passive one. Two plant types have neutral relationships but growing them together saves space because they both occupy a slightly different niche. The benefit you get is more produce per surface area.
The coin-side of companion planting is that some plant species cannot tolerate the presence of other plant species. Some caution is therefore adviced. Don't just put anything together without researching first if they get along. They might actually hinder each other. And sometimes the negative effect is quite large! For instance, never grow brassicas next to your tomatoes. They inhibit the growth of your tomatoes.
Companion planting used to be restricted to a niche user base, but has gained a lot of popularity over the last decade. The advantages seem clear and there doesn't seem to be any downside to it.
Asparagus benefits from the presence of tomatoes. The tomato plant has a repelling effect on the asparagus beetle.
Marigold is extremely useful for many crop plants. Marigold can repel the white fly and is a deterrent for root knot nematodes. It protects your plants from nematodes by producing a substance called alpha-terthienyl, which is a phototoxin and acts as a nematicide. And marigold looks good. Plant a few marigolds next to your tomato seedling or plant. It is easy to raise marigold from seed so if you are on a budget you might consider this. Seeds are cheap, germinate well, and seedlings are robust. Another method to apply the benficial effectsof marigold is to plant a dense field of marigold in preparation for next season. If you have plenty of space and you like a bed of flowers once in a while this could be an option for you. A variant of this is to till all your marigolds into your soil at the end of the season instead of composting them. They will release the beneficial chemicals when they decompose and leave some protection for the next season.
Keep in mind that not all marigolds are created equal. Most varieties have been bred for show and not their effectiveness as a companion plant. The most effective varieties seem to be Mexican marigold, Tagetes erecta, and French marigold, Tagetes patula. Mexican marigold is often known as African marigold. Most sources recommend using French marigold.
Onions occupy a different niche than tomatoes. They stay low and don't have a spread-out foliage. They also give out a scent that deters some pests. Plant a row of onion bulbs next to your tomatoes or a row on each side.
Basil can repel flies and mosquitoes, but the problem is you tend to have to plant a lot of basil before you see an effect, at the least 3 basil plants per tomato. And then these pests aren't typically a major threat to your tomatoes in a normal season. Although basil and tomatoes are culinary friends, it might not be productive to use it as a protective companion plant. Unless you are very much into making pesto by the boatloads.
Celery's effects on tomatoes are not quite clear. It mainly seems to be that celery grows a bit better around tomatoes. The best way to plant is also not clear when examining various resources. Experiment and use with caution.
Chives are mentioned often as a good companion plant for tomatoes. However, the effect or method is mostly not mentioned. One suggested effect is that chives repel aphids. Usually aphids are not problematic for tomato plants but it does happen under certain circumstances. Use and experiment with caution.
Garlic is not a straightforward companion plant for tomatoes. There are some reports that a garlic spray might have a controlling effect on late blight affected tomatoes and potatoes. But we cannot recommend that. The best way to deal with late blight is to destroy the plants. Planting garlic in between your tomatoes can have some repelling effect on spider mites according to multiple sources. Plant the garlic bulbs fairly close to your tomato plants.
Parsley planted along tomatoes can give some extra vigour to the plants, others claim it improves the flavour. It is also suggested it attracts hoverflies. This is a good thing. Hoverflies are a great addition to your garden! Not only to they look great, exhibit interesting behaviour and are totally harmless, their larvae are topnotch aphid predators! They are even used in commerical applications as a biological pest control. You cannot have too many hoverflies in your vegetable garden. Feel free to experiment with parsley as a companion plant because is always good to have it. Eat it fresh or dry it.
Mint is a wonderful plant. Step on it during your gardening and the wonderful aroma of mint is released. Problem is that it can be invasive and difficult to control. If you let it go in your garden it might not stay where you want it to be. Use with caution! Mint has a deterring effect on various pests. Ants and mosquitoes are not a fan of mint. Neither are aphids. Use with caution.
Borage can have a protective influence your tomatoes from the tomato hornworms. Borage also attracts many pollinators.
Do not plant tomatoes and brassicas together. They inhibit each others growth.
Do not plant tomatoes and potatoes near each other. They belong to the same family and are both susceptible to blight. This also means that you shouldn't plant tomatoes and potatoes in successive years in the same location, although you can normally plant tomatoes in the same location each year when supplementing the soil each year with nutrients.