In the field of underwater acoustic field prediction, numerical simulation methods and machine learning techniques are two commonly used methods. However, the numerical simulation method requires grid division. The machine learning method can only sometimes analyze the physical significance of the model. To address these problems, this paper proposes an underwater acoustic field prediction method based on a physics-informed neural network (UAFP-PINN). Firstly, a loss function incorporating physical constraints is introduced, incorporating the Helmholtz equation that describes the characteristics of the underwater acoustic field. This loss function is a foundation for establishing the underwater acoustic field prediction model using a physics-informed neural network. The model takes the coordinate information of the acoustic field point as input and employs a fully connected deep neural network to output the predicted values of the coordinates. The predicted value is refined using the loss function with physical information, ensuring the trained model possesses clear physical significance. Finally, the proposed prediction model is analyzed and validated in two dimensions: the two-dimensional acoustic field and the three-dimensional acoustic field. The results show that the mean square error between the prediction and simulation values of the two-dimensional model is only 0.01. The proposed model can effectively predict the distribution of the two-dimensional underwater sound field, and the model can also predict the sound field in the three-dimensional space.