Magnetorheological (MR) fluids are very popular among different smart materials. MR valves are used in dampers for different engineering applications where magnetostatic analysis plays a vital role in analysing the performance indices of the MR valve. In the present study, single hidden layered feedforward neural network (FNN) model is proposed to predict the magnetic flux density in the MR valve using magnetic field data generated from a finite element (FE) model in ANSYS-APDL software package. Application of neural networks in magnetostatic analysis has not been reported till now. The proposed FNN has two geometric parameters and applied current as its features (input design variables). The number of activation units in the hidden layer of FNN has been determined through error analysis. After the architecture of the FNN is defined, the FNN is trained to get optimal weights for the features and output of the hidden layer. Predictions made by the FNN and FE models are then evaluated using mean squared error method and it is shown that the FNN model's results agree with FE result fairly well. The fitted FNN model is then utilised in geometric optimisation of MR valve using a combination of genetic algorithm and sequential quadratic programming method for different application-specific weight factors. Optimal results are then compared to the unoptimized one for improvements in the objective function according to the weight factors allotted. © 2019 IOP Publishing Ltd.