Constraining geophysical models with observed data usually involves solving nonlinear and non-unique inverse problems. Mixture density networks (MDNs) produce an efficient way to estimate Bayesian posterior probability density functions (pdf's) that represent the non-unique solution. However it is difficult to infer correlations between parameters using MDNs, and in turn to draw samples from the posterior pdf. We introduce an alternative to resolve these issues: invertible neural networks (INNs). These are simultaneously trained to represent uncertain forward functions and to solve Bayesian inverse problems. In its usual form, the method becomes less effective in high dimensionality because it uses maximum mean discrepancy (MMD) to train the neural network. We show that this issue can be overcome by maximising the likelihood of the data used for training. We apply the method to two types of imaging problems: 1D surface wave dispersion inversion and 2D travel time tomography, and compare the results to those obtained using Monte Carlo and MDNs. Results show that INNs provide comparable posterior pdfs to those obtained using Monte Carlo, including correlations between parameters, and provide more accurate marginal distributions than MDNs. After training, INNs estimate posterior pdfs in seconds on a typical desktop computer. Hence they can be used to provide efficient solutions for repeated inverse problems using different data sets. And even accounting for training time, our results also show that INNs can be more efficient than Monte Carlo methods for solving single inverse problems.