In-memory computing is a highly efficient approach for breaking the bottleneck of von Neumann architectures, i.e., reducing redundant latency and energy consumption during the data transfer between the physically separated memory and processing units. Herein we have designed a in-memory computing device, a van der Waals ferroelectric semiconductor (InSe) based metal-oxide-ferroelectric semiconductor field-effect transistor (MOfeS-FET). This MOfeS-FET integrates memory and logic functions in the same material, in which the out-of-plane (OOP) ferroelectric polarization in InSe is used for data storage and the semiconducting property is used for the logic computation. The MOfeS-FET shows a long retention time with high on/off ratios (>10 6 ), high program/erase (P/E) ratios (10 3 ), and stable cyclic endurance. Moreover, inverter, programmable NAND, and NOR Boolean logic operations with nonvolatile storage of the results have all been demonstrated using our approach. These findings highlight the potential of van der Waals ferroelectric semiconductor-based MOfeS-FETs in the in-memory computing and their potential of achieving size scaling beyond Moore's law.