Encode JavaScript to Base64

The converter helps to encode JavaScript to Base64 data then to copy or download a result data in several formats. If you want decode use Base64 to JavaScript Decoder.

How to encode JavaScript to Base64 Data

  1. Input JavaScript content in field;
  2. Press Encode button;
  3. Select output format (Plain Text, Data Url, HTML JavaScript tag);
  4. Copy or Download Base64 data;
  5. Done!

Output Formats

  • Plain Text - Only Base64 data;
  • Data Url - Base64 in data url format (data:[<MIME-type>][;charset=<encoding>][;base64],<base64 data>)
  • HTML JavaScript Tag - HTML Tag <script> with Data Url data in SRC property.

Output Format Examples

Plain Text:


Data Url:


HTML JavaScript Tag:

<script src="data:text/javascript;base64,SYWxlcnQoIkhlbGxvIGZyb20gQmFzZTY0Lk9ubGluZSIpOw=="></script>