Use this service to package javascript into bookmarklets or to unpackage bookmarklets into javascript. See the motivation for why you should package bookmarklets in this way.
alert('Hello World!');
Result:
javascript:eval(atob('YWxlcnQoJ0hlbGxvIFdvcmxkIScpOw=='));
Javascript Bookmarklet Url