This code calculates the contact angle formed between a sessile drop of an arbitrarily defined liquid and a rough surface based on our improved Cassie-Baxter wetting model (https://doi.org/10.1088/2051-672X/ab9419). The topography of the surface needs to be predefined into the input file and may be any of the types: a) 2D pillars, b) fibers, c) sinusoids, d) 3D pillars. Although, theoretically, our model can be applied to topographies with arbitrarily large multiplicity, here the code was devised such that it considers up to three-level topographies hierarchically placed on top of one another. In the “Input” directory, three input files are given for single, two-level and three-level topographies, respectively. In multilevel topographies, the above-mentioned topography types may be combined at will. So, for example, we may have a three-level topography with sinusoidal pulses as the coarser level, fibers as the middle-level and 2D pillars as the finest level. Similarly, two-level and single-level topographies are also possible. The definitions of the multiplicity level and topography types proceed in the input file.