Base64 Decode Converter

    Base64 encode

    Copied

    Base64 decoding is the process of converting a Base64 encoded string back to its original data representation. In Base64 encoding, binary data is represented using a set of printable ASCII characters to ensure safe transmission over systems that may not support binary data directly.

    To decode a Base64 string, you can use built-in functions or libraries in most programming languages. Here's an example of how to decode a Base64 string in various programming languages:

    JavaScript
    // Assuming you have a Base64 encoded string
    const base64String = "SGVsbG8gV29ybGQh"; // Example Base64 encoded string
    
    // Decoding the Base64 string
    const decodedString = atob(base64String);
    console.log(decodedString); // Output: "Hello World!"
    
    

    Python
    import base64
    
    # Assuming you have a Base64 encoded string
    base64_string = "SGVsbG8gV29ybGQh"  # Example Base64 encoded string
    
    # Decoding the Base64 string
    decoded_bytes = base64.b64decode(base64_string)
    decoded_string = decoded_bytes.decode('utf-8')
    print(decoded_string)  # Output: "Hello World!"
    

    Java
    import java.util.Base64;
    
    public class Main {
        public static void main(String[] args) {
            // Assuming you have a Base64 encoded string
            String base64String = "SGVsbG8gV29ybGQh"; // Example Base64 encoded string
    
            // Decoding the Base64 string
            byte[] decodedBytes = Base64.getDecoder().decode(base64String);
            String decodedString = new String(decodedBytes);
            System.out.println(decodedString); // Output: "Hello World!"
        }
    }
    

    Note that the atob() function in JavaScript, base64.b64decode() function in Python, and Base64.getDecoder().decode() method in Java are used to perform the Base64 decoding. The decoded output should be the original data that was encoded using Base64.

    resources