> ## 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.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.firebolt.io/feedback

```json
{
  "path": "/reference-sql/functions-reference/string/url_encode",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

> 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":"github-light","dark":"github-dark"}}
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:

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT CONCAT('https://www.firebolt.io/?', URL_ENCODE('example_id=1&hl=en'));
```

**Returns**: `https://www.firebolt.io/?example_id%3D1%26hl%3Den`

## Related

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