K-means clustering is one of the non-hierarchical clustering algorithms that partitions n objects into k clusters. K-means clustering is used to determine which cluster an object belongs to by calculating the proximity distance between the object and the cluster center (centroid). This research aims to form a portfolio using K-means clustering and determine the weights of the portfolio using the Mean Variance Efficient Portfolio (MVEP) method. The data analyzed in this research is the closing price data of 11 stocks in the LQ45 index from January 3, 2022, to January 3, 2023. The analysis results obtained using K-means clustering reveal the formation of two portfolios. The first portfolio consists of the stocks BMRI, INCO, INDF, INTP, and SMGR. The second portfolio consists of the stocks ADRO, ANTM, BBRI, ERAA, and UNVR. Based on the MVEP method calculation, the weights of each stock in the first portfolio are 22.74\% (BMRI), 10.11\% (INCO), 49.76\% (INDF), 18.75\% (INTP), and -1.36\% (SMGR). The calculation results of stock weights show that there is a stock weight with a negative value, which is -1.36\% for SMGR, indicating a short sale in the investment. Furthermore, the weighting results for the second portfolio are 7.08\% (ADRO), 9.62\% (ANTM), 34.05\% (BBRI), 24.80\% (ERAA), and 24.45\% (UNVR).The variance values of stock portfolio 1 and stock portfolio 2 are 0.000080 and 0.000137, respectively. From the portfolio variance results, it is known that the risk of portfolio 1 is 0.008953 and the risk of portfolio 2 is 0.011706.