SQL Flow Field Guide

BASE64_DECODE

Catalog support for SQL Server 2025 (17.x)

string transform

What changes

Input
string arguments
Output or change
string or integer
Return type
varbinary(8000) if the input is varchar(n). varbinary(max) if the input is varchar(max). If the input expression is NULL, the output is NULL.

Syntax at a glance

BASE64_DECODE ( expression )

Work example

Decode base64 text to bytes at a trusted data boundary.

Test Unicode, trailing spaces, collation, empty input, and maximum output length.

Check your work Reject malformed input and remember that base64 gives no confidentiality or integrity.

Open Microsoft Learn for full syntax, permissions, and details for your version.