> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

> Reference material for URL_ENCODE function

# URL_ENCODE

Encodes all characters that are not unreserved using [percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).

Unreserved characters are defined according to [W3C RFC 3986](https://www.rfc-editor.org/rfc/rfc3986.html).

```
unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"
```

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
URL_ENCODE(<expression>)
```

## Parameters

| Parameter      | Description               | Supported input types |
| :------------- | :------------------------ | :-------------------- |
| `<expression>` | The string to be encoded. | `TEXT`                |

## Return Type

`TEXT`

## Example

The example below converts characters that are not unreserved that appear in the parameter section of the URL:

<div className="query-window">
  ```
  SELECT CONCAT('https://www.firebolt.io/?', URL_ENCODE('example_id=1&hl=en'));
  ```

  | concat <span>text</span>                                                                                |
  | :------------------------------------------------------------------------------------------------------ |
  | [https://www.firebolt.io/?example\_id%3D1%26hl%3Den](https://www.firebolt.io/?example_id%3D1%26hl%3Den) |

  <p><span>Rows: 1</span><span>Execution time: 5.24ms</span></p>
</div>

## Related

* [URL\_DECODE](/reference-sql/functions-reference/string/url_decode)
