Java : decode()

Converts the given string, which encodes binary data in Base64 format, into an equivalent array of 8-bit unsigned integers.


Function

public static byte[] decode(java.lang.String str)

Parameters

str - The Base64-encoded str.

Return value

The corresponding byte array.

Example

import java.util.Base64;
import java.nio.charset.StandardCharsets;

public class Base64Decode {
  public static void main(String[] args) {
    String encoded = "SSB3aWxsIGNvbWUgYmFjayBzb29u";
    byte[] decoded = Base64.getDecoder().decode(encoded);
    String decodedStr = new String(decoded, StandardCharsets.UTF_8);

    System.out.println(decodedStr);
  }
}

Home Page Base64Decode List Privacy Policy About Us Contact

This website uses cookies to enhance your experience, personalize content and ads, and analyze our traffic.

©2025 Design by base64decodeonl.com