Network coding (NC) is a forward-looking technology of coding technology, which can rapidly improve the network throughput and bandwidth available in Mobile Ad hoc NETwork (MANET). Sliding window network coding is an improved encoding of network coding, which increases the network throughput of TCP to MANETs by increasing the sliding mechanism. In this paper, we propose a Variable Length Sliding Window Network Coding algorithm in MANETs (VLSWNC). The performance of the VLSWNC is experiments studied by using NS2 and evaluated in terms of the network throughput, packet loss probability, and decoding delay when data packet is transmitted. Simulation results show that VLSWNC can significantly improve network throughput and achieve better network performance.