You may need to think quickly to find tomato substitutes if you are in the midst of a recipe and realize you’re short of this key flavoring ingredient.
Many people don’t think about tomato substitutes since these fruits are such a common presence in the kitchen and in our recipes. The role they play in cooking is so seminal that it can leave a large gap if you’re trying to avoid tomatoes or cooking for someone with an allergy. Luckily, there are some great potential substitutes out there that can provide both the flavor and consistency of tomatoes, these include red bell pepper, tamarind paste, mango, gherkins, umeboshi paste, green pesto, and stock and vinegar among others. 
Red Bell Pepper
Red bell peppers are a great first alternative to tomatoes. They can be used fresh for salads and sandwiches and will provide a similar color and texture in a cooked dish. You can try a red pepper paste to get a deeper range of flavors or even add your own sugar, lemon, and salt to blended roasted peppers to create a good substitute for tomato sauce or paste.
Tamarind is a sharp, sweet, and sour fruit. The concentrate can go a long way to replacing tomatoes in sauces, soups, and curries. Look for it in Latin American, Asian or Indian stores. It’s slightly on the pricey side but has a long shelf life if refrigerated and a little can go a long way in any recipe. 
Strange though it may sound, an unripe mango can make a great replacement for tomato due to its similarities in texture and flavor. Unripened a mango is not very sweet and can offer a sharp tartness that mirrors tomatoes well. Try it in sandwiches, salads, and salsas!
Gherkins are zingy and fresh, which make them a great substitute for tomatoes in salads and sandwiches.
This is a paste made from pickled Japanese plums. It is salty, tangy, and almost sweet in much the same way as tomatoes. Try adding a little at a time and taste as you go. You can also reduce the salt elsewhere in your recipe to balance out the notable saltiness of this paste. 
It may take your dish in a slightly different direction, but substituting pesto for tomatoes will give you a similar texture and an interesting depth of flavor that may become your new favorite twist!
Stock and Vinegar
In an emergency, you might get some of the depth of flavor by using stock with just a dash of vinegar for tanginess. This will work best in liquid recipes, such as soups and sauces.