Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

FROM_HEX function - Amazon Redshift

FROM_HEX function

FROM_HEX converts a hexadecimal to a binary value.

Syntax

FROM_HEX(hex_string)

Arguments

hex_string

Hexadecimal string of data type VARCHAR or TEXT to be converted. The format must be a literal value.

Return type

VARBYTE

Examples

To convert the hexadecimal representation of '6162' to a binary value, use the following example. The result is automatically shown as the hexadecimal representation of the binary value.

SELECT FROM_HEX('6162'); +----------+ | from_hex | +----------+ | 6162 | +----------+
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.