HTML sanitization is the process of examining an HTML document and producing a new HTML document that preserves only whatever tags are designated safe.