# bytes.to_base64 ## Function Convert Bytes to Base64 text. ## Syntax ```bt bytes(value).to_base64(mode) ``` ## Parameters | Parameters | Type | Required | Default value | Description | |------|------|------|------|------| | mode | String/Int | No | Standard Base64 | Optional `standard_no_pad`, `url_safe`, `url_safe_no_pad`, also compatible with base64 library's 0 to 3 numeric mode. | ## Return value | Type | Description | |------|------| | String | Base64 text. | ## Code Example ```bt data = bytes('BT') text = data.to_base64() // Output: QlQ= print text ``` ## Notes - To parse Base64 use `bytes(text, 'base64')` or `bytes({base64: text})`.