or a stereoisomer, a tautomer, or a pharmaceutically acceptable salt thereof, wherein all the variables are as defined herein. These compounds are selective factor XIa inhibitors or dual inhibitors of FXIa and plasma kallikrein. This invention also relates to pharmaceutical compositions comprising these compounds and methods of treating thromboembolic and/or inflammatory disorders using the same.