url_encode
Percent-encode a string to safely include as a URL component. Escapes characters like &, =, #, spaces, and non-ASCII characters using encodeURIComponent semantics. Pass only the component, not the full URL. Returns encoded string.
Instructions
Percent-encode an arbitrary string so it is safe to embed as a URL component (query value, path segment, or fragment). Use to escape characters like &, =, #, spaces, and non-ASCII before appending to a URL; uses encodeURIComponent semantics, so / is encoded — do not pass a full URL, only the component that needs escaping. Pure local transform with no network calls. Returns the percent-encoded string as plain text. Always succeeds.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | String to percent-encode, e.g. a query parameter value like "hello world" or "a=b&c=d". Pass only the component, not the full URL. |