Skip to main content
Scalar function
Returns NULL for NULL arguments, from_base outside 2 through 36, or abs(to_base) outside 2 through 36.

Syntax

Scalar

Arguments

Returns

  • Type: STRING
  • Possible values: Uppercase base digits 0-9 and A-Z, with a minus sign for negative signed output.
  • NULL behavior: Returns NULL for NULL arguments, from_base outside 2 through 36, or abs(to_base) outside 2 through 36.

Properties

Usage notes

  • Leading and trailing whitespace is stripped. An optional sign is accepted.
  • Parsing stops at the first digit that is invalid in from_base. An empty or initially invalid digit sequence yields zero.
  • Input is interpreted as an unsigned 64-bit value. Negative text wraps within that range before the result is interpreted as signed or unsigned.

Examples

Value and NULL input

Convert between bases

Limitations

  • Input beyond the unsigned 64-bit range raises an error.
Last modified on October 15, 2026