ABSTRACT This paper presents a method of subsurface modelling based on a Markov random field (MRF) model called Potts model. Potts model is an undirected graphical model and has been applied in image processing such as image denoising, restoration and inpainting. The proposed method is simple and requires only a few borehole data on soil types in both training and inference stages. Current implementations of the Potts model require substantial data for training, and they are not suitable for subsurface modelling. The proposed method was demonstrated through numerical examples for 2D and 3D virtual grounds and a real case history. In the numerical examples, the effect of the number of training datasets on the estimation results was also investigated. The proposed method can provide not only the most probable inference of subsurface model but also the spatial distribution of geological uncertainty and is compatible with reliability-based analysis in geotechnical engineering. The spatial distribution of uncertainty is informative in its own right. It directs the engineer to focus on mechanically important zones where the critical failure mechanism passes through if they coincide with the low-accuracy zones.