Follow these steps to encode your JavaScript into Base64 data:
- Input your JavaScript content in the provided field.
- Click on the “Encode” button.
- Choose your preferred output format:
Plain Text: Outputs only the Base64 data.
Data URL: Base64 data in a data URL format (data:[<MIME-type>][;charset=<encoding>][;base64],<base64 data>).
HTML JavaScript Tag: Generates an HTML <script> tag with the Base64 data in the SRC property. - Copy or download the Base64 data as per your requirement.
- Done!
Output Format Examples:
Plain Text:
YWxlcnQoIkhlbGxvIGZyb20gQmFzZTY0Lk9ubGluZSIpOw==
Data URL:
data:text/javascript;base64,YWxlcnQoIkhlbGxvIGZyb20gQmFzZTY0Lk9ubGluZSIpOw==
HTML JavaScript Tag:
<script src=”data:text/javascript;base64,SYWxlcnQoIkhlbGxvIGZyb20gQmFzZTY0Lk9ubGluZSIpOw==”></script>
Feel free to input your JavaScript and experiment with different output formats!