Loading section...

TO_BASE64() / FROM_BASE64()

Basic Concepts Base64 solves a fundamental problem: binary data contains bytes that are not valid text characters. Attempting to store raw binary in a text field corrupts the data. Base64 transforms binary into safe text that survives any text processing. The = characters at the end are padding. Base64 works in groups of 4 characters, and padding fills incomplete groups. The encoded result contains only letters, numbers, plus, slash, and equals. Encoding & Decoding Decoding Base64 to Text Best Practices Many APIs require Base64-encoded payloads or return Base64-encoded responses: Log tables often store API responses in Base64 to handle binary content safely. This query decodes them for analysis. The same pattern works for request bodies, file contents, or any binary data stored as text. Ba