Base64 Encode online

This tool helps you to convert a text or a number to Base64

Enter a string then convert to base64

Encodes data with MIME base64

The tool supports encoding any text to base64 code, the way to use is very simple, you just need to enter text and press the button to get the results.

Base64 encode in Php

$base64EncodeValue = base64_encode($string);
echo $base64EncodeValue;
//output: c2l0YS5hcHA=

See also base64 decode in php

Base64 encode in javascript

this is source code simple base64 encode for javascript or nodejs.

var string='';
var base64EncodeValue = btoa(a);
//output: c2l0YS5hcHA=

See also base64 decode in javascript

Base64 encode in JAVA

This is source code simple base64-encoder for java

import java.util.Base64;
import java.util.UUID;
public class HelloWorld {
   public static void main(String args[]) {
      try {
         // Encode using basic encoder
         String base64encodedString = Base64.getEncoder().encodeToString(
         System.out.println("Base64 Encoded String :" + base64encodedString);
         //output: aHR0cHM6Ly9zaXRhLmFwcC9iYXNlNjQtZW5jb2Rl
      } catch(UnsupportedEncodingException e) {
         System.out.println("Error :" + e.getMessage());

Base64 encode in Dart

This is source code simple base64-encoder for dart.
Dart has a function in the package:crypto library, CryptoUtils.bytesToBase64, which takes a list of bytes to encode as base64.

import 'dart:convert';
import 'package:crypto/crypto.dart';
main() {
  var str = "";
  var bytes = UTF8.encode(str);
  var base64 = CryptoUtils.bytesToBase64(bytes);