## Syntax ```mermaid %%{init: { 'theme': 'base', 'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' }, 'themeVariables': { 'fontSize': '11px', 'fontFamily': 'Arial' } }}%% flowchart LR Start((START)) --> BASE64_ENCODE[BASE64_ENCODE]:::quoted BASE64_ENCODE --> FUNCPARS1["("]:::quoted FUNCPARS1 --> FUNCPARS2[parameters] FUNCPARS2 --> FUNCPARS3[")"]:::quoted FUNCPARS3 --> End((END)) ``` ## Purpose The `BASE64_ENCODE` SQL function converts a binary object (`blob`) to base64 encoded characters as defined on [Wikipedia](https://en.wikipedia.org/wiki/Base64). See also [[BASE64_DECODE]]. Parameters: - Input: value to convert to base64 characters. Returns: the binary input encoded to base64 characters. ## Examples `BASE64_ENCODE` maps the text `hi` first as ASCII 7-bit to a binary object, and then to the base64 representation: ```sql select base64_encode(ascii_to_blob('hi')) -------- aGk= ```