What is Byte order mark (BOM) According to W3C definition BOM is Unicode character encoding that appear as a magic…