https://github.com/yckart/jquery.base64.js var a="123"; var b=$.base64.btoa(a); console.log(a===$.base64.atob(b))