--- type: "fhirpath-function" title: "FHIRPath Function: decode" function: "decode" category: "Additional String Functions" section: "5.7.2" source: "fhirpath/functions.json" --- # FHIRPath Function: decode {:.stu} The decode function takes a singleton encoded string and returns the result of decoding that string according to the given format. The format parameter defines the encoding format. Available formats are listed in the encode function (excluding 'ascii'). {:.stu} If the input is empty, the result is empty. {:.stu} If no format is specified, the result is empty. {:.stu} ## Summary - **Category**: Additional String Functions - **Section**: `5.7.2` - **Return Type**: `String` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `true` ## Description The decode function takes a singleton encoded string and returns the result of decoding that string according to the given format. Available formats are hex, base64, and urlbase64. ## Arguments - `format`: `String` - Encoding format (hex, base64, urlbase64) ## Type Mapping - `String-String` ## Example ```fhirpath '74657374'.decode('hex') // returns 'test' ```