The elastic deformation and piezoelectric field in GaN /AlN/ quantum dots have been investigated. The electronic levels of quantum dots have been given in this paper. The 3D strain field and piezoelectric potential are calculated based on and the effective mass theory and finite element method. The effect of spontaneous and piezoelectric polarization is taken into account in the calculation. The ground bound state and the several lowest excited states of quantum dots have been studied. It is found that the size of quantum dots controls the conduction band edge, electronic levels and more other optical properties. The calculation results are very helpful in designing high quality infrared photodetector and laser.