Unitoolify URL Encode

Safely encode strings for URLs

Encode Decode ← Home

About URL Encoding

URL encoding is just percent-encoding: any character that isn't safe in a URL becomes a "%" followed by two hex digits. A space turns into %20, "&" into %26, and so on. This tool wraps JavaScript's native encodeURIComponent() so you don't have to open a console to try it.

You need this any time a URL contains something you didn't type by hand — search terms, form values, redirect targets, anything with spaces or non-ASCII characters. Skip the encoding and the browser will mangle the URL, silently drop parameters, or both.

Since it all runs in your browser, there's nothing to upload — fine for URLs that embed tokens or private payloads.

Frequently Asked Questions

What is URL encoding or percent-encoding?

URL encoding (percent-encoding) replaces unsafe ASCII characters in a URI with a "%" followed by two hexadecimal digits. For example, a space becomes %20 and a Chinese character is encoded as multiple percent-encoded UTF-8 bytes. This guarantees the URL is transmitted safely over the internet.

When should I URL-encode a string?

Encode any dynamic text you place into a URL: user input, search terms, query-string values, redirect targets and non-ASCII characters. Encoding prevents broken URLs, missing parameters and injection issues.

Why are spaces encoded as %20?

Spaces are not valid inside URLs. The encoder converts them to %20 (and form data typically uses "+" instead). The tool uses encodeURIComponent, which produces %20.

Is my data sent to a server?

No. Encoding runs entirely in your browser with JavaScript. Your text is never uploaded, so you can safely encode private tokens and payloads.

Related Tools