Medium and high entropy alloys (MEAs and HEAs) based on 3d transition metals, such as face-centered cubic (fcc) CrCoNi and CrMnFeCoNi alloys, reveal remarkable mechanical properties. The stacking fault energy (SFE) is one of the key ingredients that controls the underlying deformation mechanism and hence the mechanical performance of materials. Previous experiments and simulations have therefore been devoted to determining the SFEs of various MEAs and HEAs. The impact of local chemical environment in the vicinity of the stacking faults is, however, still not fully understood. In this work, we investigate the impact of the compositional fluctuations in the vicinity of stacking faults for two prototype fcc MEAs and HEAs, namely CrCoNi and CrMnFeCoNi by employing first-principles calculations. Depending on the chemical composition close to the stacking fault, the intrinsic SFEs vary in the range of more than 150 mJ/m 2 for both the alloys, which indicates the presence of a strong driving force to promote particular types of chemical segregations towards the intrinsic stacking faults in MEAs and HEAs. Furthermore, the dependence of the intrinsic SFEs on local chemical fluctuations reveals a highly non-linear behavior, resulting in a non-trivial interplay of local chemical fluctuations and SFEs. This sheds new light on the importance of controlling chemical fluctuations via tuning, e.g., the annealing condition to obtain the desired mechanical properties for MEAs and HEAs.