Output encoding, also known as output sanitization, is a technique used to convert user- generated input in a web form before it is displayed by the browser. This technique helps to prevent cross-site scripting (XSS) attacks, which occur when attackers inject malicious code into a web page, causing it to execute in the user's browser.