High-quality datasets are of paramount importance for the operation and planning of wind farms. However, the datasets collected by the supervisory control and data acquisition (SCADA) system may contain missing data due to various factors such as sensor failure and communication congestion. In this paper, a data-driven approach is proposed to fill the missing data of wind farms based on a context encoder (CE), which consists of an encoder, a decoder, and a discriminator. Through deep convolutional neural networks, the proposed method is able to automatically explore the complex nonlinear characteristics of the datasets that are difficult to be modeled explicitly. The proposed method can not only fully use the surrounding context information by the reconstructed loss, but also make filling data look real by the adversarial loss. In addition, the correlation among multiple missing attributes is taken into account by adjusting the format of input data. The simulation results show that CE performs better than traditional methods for the attributes of wind farms with hallmark characteristics such as large peaks, large valleys, and fast ramps. Moreover, the CE shows stronger generalization ability than traditional methods such as auto-encoder, K-means, k-nearest neighbor, back propagation neural network, cubic interpolation, and conditional generative adversarial network for different missing data scales.