base64.b64encode() in Python Last Updated : 26 Mar, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report With the help of base64.b64encode() method, we can encode the string into the binary form. Syntax : base64.b64encode(string) Return : Return the encoded string. Example #1 : In this example we can see that by using base64.b64encode() method, we are able to get the encoded string which can be in binary form by using this method. Python3 1=1 # import base64 from base64 import b64encode s = b'GeeksForGeeks' # Using base64.b64encode() method gfg = b64encode(s) print(gfg) Output : b'R2Vla3NGb3JHZWVrcw==' Example #2 : Python3 1=1 # import base64 from base64 import b64encode s = b'I love python' # Using base64.b64encode() method gfg = b64encode(s) print(gfg) Output : b'SSBsb3ZlIHB5dGhvbg==' Comment More infoAdvertise with us Next Article base64.b32encode() in Python J jitender_1998 Follow Improve Article Tags : Python Python base64-module Practice Tags : python Similar Reads base64.b16encode() in Python With the help of base64.b16encode() method, we can encode the string by using base16 alphabet into the binary form. Syntax : base64.b16encode(string) Return : Return the encoded string. Example #1 : In this example we can see that by using base64.b16encode() method, we are able to get the encoded st 1 min read base64.b64decode() in Python With the help of base64.b64decode() method, we can decode the binary string into normal form. Syntax : base64.b64decode(b_string) Return : Return the decoded string. Example #1 : In this example we can see that by using base64.b64decode() method, we are able to get the decoded string which can be in 1 min read base64.b32encode() in Python With the help of base64.b32encode() method, we can encode the string by using base32 alphabet into the binary form. Syntax : base64.b32encode(string) Return : Return the encoded string. Example #1 : In this example we can see that by using base64.b32encode() method, we are able to get the encoded st 1 min read base64.b85encode() in Python With the help of base64.b85encode() method, we can encode the string by using base85 alphabet into the binary form. Syntax : base64.b85encode(string) Return : Return the encoded string. Example #1 : In this example we can see that by using base64.b85encode() method, we are able to get the encoded st 1 min read base64.b16decode() in Python With the help of base64.b16decode() method, we can decode the binary string using base16 alphabets into normal form. Syntax : base64.b16decode(b_string) Return : Return the decoded string. Example #1 : In this example we can see that by using base64.b16decode() method, we are able to get the decoded 1 min read base64.b32decode() in Python With the help of base64.b32decode() method, we can decode the binary string using base32 alphabets into normal form. Syntax : base64.b32decode(b_string) Return : Return the decoded string. Example #1 : In this example we can see that by using base64.b32decode() method, we are able to get the decoded 1 min read Like