Shared genetic architecture between phenotypes may be driven by a common genetic basis (pleiotropy) or a subset of genetically similar individuals (heterogeneity). We developed BUHMBOX, a well-powered statistical method to distinguish pleiotropy from heterogeneity using genotype data. We observed a shared genetic basis between 11 of 17 tested autoimmune diseases and type I diabetes (T1D, p<10 12) and 11 of 17 tested autoimmune diseases and rheumatoid arthritis (RA, p<10-7). This sharing could not be explained by heterogeneity (corrected pBUHMBOX>0.2 using 6,670 T1D cases and 7,279 RA cases), suggesting that shared genetic features in autoimmunity are due to pleiotropy. We observed a shared genetic basis between seronegative and seropostive RA (p<10-22), explained by heterogeneity (pBUHMBOX=0.008 in 2,406 seronegative RA cases). Consistent with previous observations, we observed genetic sharing between major depressive disorder (MDD) and schizophrenia (p<10 9). This sharing is not explained by heterogeneity (pBUHMBOX=0.28 in 9,238 MDD cases).