Uploaded December 2018 | Updated September 2026, 1 week ago
This tutorial explains how to encode a plain text string into base64 format, using the ESP32 and the Arduino core.
**IMPORTANT NOTE**: as indicated in the implementation file of the library, the caller is responsible for freeing the returned buffer with the encoded string. So, although not included in the video, you should call the free function on the returned pointer when you no longer need it.
Implementation file: github.com/espressif/esp-idf/blob/aaf12390eb14b95589acd98db5c268a2e56bb67e/components/wpa_supplicant/src/wpa2/utils/base64.c
Free function: en.cppreference.com/w/c/memory/free
Base64 encode online tool: base64encode.org
Base64 decode online tool: base64decode.org
Format specifiers: cplusplus.com/reference/cstdio/printf
Related content (written tutorials):
Base64 encoding: techtutorialsx.com/2017/12/09/esp32-arduino-base64-enconding
Base64 decoding: techtutorialsx.com/2018/11/27/esp32-arduino-base64-decoding
HMAC SHA256: techtutorialsx.com/2018/01/25/esp32-arduino-applying-the-hmac-sha-256-mechanism
AES ECB mode: techtutorialsx.com/2018/04/18/esp32-arduino-encryption-using-aes-128-in-ecb-mode
A lot more ESP32 tutorials:
techtutorialsx.com/category/esp32
ESP8266 tutorials:
techtutorialsx.com/category/esp8266
This tutorial explains how to encode a plain text string into base64 format, using the ESP32 and the Arduino core.
**IMPORTANT NOTE**: as indicated in the implementation file of the library, the caller is responsible for freeing the returned buffer with the encoded string. So, although not included in the video, you should call the free function on the returned pointer when you no longer need it.
Implementation file: github.com/espressif/esp-idf/blob/aaf12390eb14b95589acd98db5c268a2e56bb67e/components/wpa_supplicant/src/wpa2/utils/base64.c
Free function: en.cppreference.com/w/c/memory/free
Base64 encode online tool: base64encode.org
Base64 decode online tool: base64decode.org
Format specifiers: cplusplus.com/reference/cstdio/printf
Related content (written tutorials):
Base64 encoding: techtutorialsx.com/2017/12/09/esp32-arduino-base64-enconding
Base64 decoding: techtutorialsx.com/2018/11/27/esp32-arduino-base64-decoding
HMAC SHA256: techtutorialsx.com/2018/01/25/esp32-arduino-applying-the-hmac-sha-256-mechanism
AES ECB mode: techtutorialsx.com/2018/04/18/esp32-arduino-encryption-using-aes-128-in-ecb-mode
A lot more ESP32 tutorials:
techtutorialsx.com/category/esp32
ESP8266 tutorials:
techtutorialsx.com/category/esp8266










