--- title: "Converting string to/from Base64" slug: "converting-string-tofrom-base64" updated: 2023-01-06T15:50:01Z published: 2023-01-06T15:50:00Z canonical: "docs.catchpoint.com/converting-string-tofrom-base64" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.catchpoint.com/llms.txt > Use this file to discover all available pages before exploring further. # Converting string to/from Base64 ## Overview The sub-macro `base64to()` converts a string to base64. This can be used within an `extract` macro as a third parameter, or within a `var` macro. The sub-macro `base64from()` is used to decode a base64 string. This can be used with `extract` macro as well as with `var` macro. ## Examples ### **syntax: base64to()** **Example**: ``` var val = 123456789; var valToBase64 = ${var(val, base64to())}; var data = ${extract("resp-content", "regexp: