ABSTRACT (Sub)millimetre dust opacities are required for converting the observable dust continuum emission to the mass, but their values have long been uncertain, especially in discs around young stellar objects. We propose a method to constrain the opacity κν in edge-on discs from a characteristic optical depth τ0,ν, the density ρ0, and radius R0 at the disc outer edge through κν = τ0,ν/(ρ0R0), where τ0,ν is inferred from the shape of the observed flux along the major axis, ρ0 from gravitational stability considerations, and R0 from direct imaging. We applied the 1D semi-analytical model to the embedded, Class 0, HH 212 disc, which has high-resolution data in Atacama Large Millimetre/submillimetre Array (ALMA) bands 9, 7, 6, and 3 and Very Large Array Ka band (λ = 0.43, 0.85, 1.3, 2.9, and 9.1 mm). The modelling is extended to 2D through RADMC-3D radiative transfer calculations. We find a dust opacity of κν ≈ 1.9 × 10−2, 1.3 × 10−2, and 4.9 × 10−3 cm2 g−1 of gas and dust for ALMA bands 7, 6, and 3, respectively, with uncertainties dependent on the adopted stellar mass. The inferred opacities lend support to the widely used prescription κλ = 2.3 × 10−2(1.3mm/λ) cm2 g−1 . We inferred a temperature of ∼45 K at the disc outer edge that increases radially inwards. It is well above the sublimation temperatures of ices such as CO and N2, which supports the notion that the disc chemistry cannot be completely inherited from the protostellar envelope.