A method for masking sensitive content, the method comprising: receiving a request to mask input content, wherein the input content is of one or more types of format, and wherein the input content includes at least one of sensitive content and non-sensitive content; parsing the input content based on the one or more types of format of the input content to create a content specific structure (CSS) and organize the input content into content specific structured format, wherein the CSS includes a plurality of nodes and at least one relation among the plurality of nodes; analysing each CSS node from amongst the plurality of CSS nodes based on a pre-defined policy to identify value corresponding to at least one content attribute associated with the each CSS node; wherein content attributes include sensitivity attributes; creating a generalised masking structure (GMS) including a plurality of GMS nodes and at least one relation among the plurality of GMS nodes based on the CSS, wherein the GMS is a structure representing sensitivity attributes of the input content within each CSS node, wherein one GMS node is created for each of the plurality of CSS nodes, and the at least one relation among the GMS nodes represents the corresponding at least one relation among the CSS nodes, and wherein each GMS node is associated with the at least one content attribute of the corresponding CSS node, wherein the at least one content attribute comprises the sensitivity attributes of the content within the corresponding CSS node; and identifying a value of the sensitivity attributes of the content associated with each of the plurality of GMS nodes by comparing each GMS node against a pre-defined privacy policy; and creating a reduced generalized masking structure (R-GMS) from the GMS based on the sensitivity attributes of the GMS nodes, wherein creating the R-GMS further comprises: identifying at least one set of GMS nodes from amongst the plurality of GMS nodes of the GMS with same value of the sensitivity attributes, and grouping the GMS nodes of the identified set of GMS nodes into a single GMS node; masking the input content, irrespective of the one or more types of format of the input content, based on the R-GMS, by masking the input content within each CSS node based on the value of the sensitivity attributes of the input content associated with each corresponding GMS node of the plurality of GMS nodes from the R-GMS. receiving a request to mask input content, wherein the input content is of one or more types of format, and wherein the input content includes at least one of sensitive content and non-sensitive content; parsing the input content based on the one or more types of format of the input content to create a content specific structure (CSS) and organize the input content into content specific structured format, wherein the CSS includes a plurality of nodes and at least one relation among the plurality of nodes; analysing each CSS node from amongst the plurality of CSS nodes based on a pre-defined policy to identify value corresponding to at least one content attribute associated with the each CSS node; wherein content attributes include sensitivity attributes; identifying at least one set of GMS nodes from amongst the plurality of GMS nodes of the GMS with same value of the sensitivity attributes, and grouping the GMS nodes of the identified set of GMS nodes into a single GMS node; masking the input content, irrespective of the one or more types of format of the input content, based on the R-GMS, by masking the input content within each CSS node based on the value of the sensitivity attributes of the input content associated with each corresponding GMS node of the plurality of GMS nodes from the R-GMS. <EOS>