Online Defer Inline Javascript
Turn inline scripts into deferred or async tags so they stop blocking page render.
What it is for?What it is for?
Why defer inline scripts?
Deferred and async scripts do not block rendering, so the page appears sooner and the PageSpeed score goes up. Async is fastest, but many older templates expect scripts to run in order, so defer is the safer choice. An inline script cannot be deferred on its own. This tool wraps it in a data URL so the defer attribute applies to it.
Example
console.log('test');
will be converted to
<script defer src="data:text/javascript;base64,Y29uc29sZS5sb2coJ3Rlc3QnKTs="></script>
You can replace defer with async if the script does not depend on others.