With the advent of post-Moore era, the development of memory devices based on bulk materials gradually entered the bottleneck period. Two-dimensional (2D) materials have received much attention due to their excellent optoelectronic and mechanical properties. Also, floating-gate devices based on 2D van der Waals heterostructures have drawn widespread attention in virtue of their great potential for nonvolatile memory. In this paper, a floating-gate device based on a MoS 2 /BN/graphene heterostructure was fabricated and its electrical storage performance and synaptic function were investigated. Finally, the device obtains a switching ratio of close to ∼10 5 , a large storage window of 107.8 V under a sweeping range of ±60 V, good endurance after 1000 cycles, and charge retention capability above 1500 s. In addition, the device can be used as an artificial synapse to simulate a basic synaptic function and achieve a more linear and symmetrical longterm potentiation and long-term depression profiles. At the same time, the constructed convolutional neural network using this device reaches a high recognition accuracy of 95.5% for handwritten numerals after 1000 times training. These results demonstrate the great potential of 2D material floating-gate devices for nonvolatile memory and neuromorphic computing, which pave the way for the development of next-generation memory devices.