If a recipe specifically calls for lemons or limes and you only have one of these citrus fruits, you can sometimes swap them, but not always. The results will depend on the dish.
Differences like the flavor, level of acidity, sweetness, and the volume of juice they contain mean lemons and limes are not always interchangeable.
Lemon and lime juice can be used interchangeably in baking if its purpose is to add a little tang, but if lemon or lime is the predominant flavor of the dessert, it won’t work.
In cocktails, the juices of lemons and limes can often be swapped with each other in equal amounts, though the final flavor may vary according to the drink.
When canning foods, lemon and lime juice can be used interchangeably due to their close pH levels. In salad dressings, they both add brightness and freshness, so either will work.
Ultimately, the best way to assess how well the citrus swap works is to add a small amount at a time to a dish or drink and taste it to judge the balance and overall flavor.