URL Encoder

URLs can only safely contain a limited set of characters. Anything outside that set — spaces, ampersands, non-Latin characters, and more — needs to be percent-encoded before it can be safely included in a URL, particularly in query strings. This tool encodes any text into its URL-safe, percent-encoded form.

Your data stays in your browser — this tool runs entirely on the client side and nothing is uploaded to a server.

How to Use the URL Encoder

  1. Type or paste the text you want to encode.
  2. The URL-encoded result appears instantly.
  3. Copy the result to use safely inside a URL or query string.

What is URL/percent encoding?

Percent encoding replaces unsafe or reserved characters with a "%" followed by their two-digit hexadecimal ASCII (or UTF-8 byte) value. For example, a space becomes `%20` and an ampersand becomes `%26`. This lets any text be safely embedded inside a URL without breaking its structure.

Reserved characters

Certain characters have special meaning in a URL's structure — `&` separates query parameters, `=` separates a key from its value, `?` starts the query string, `/` separates path segments, and `#` starts a fragment. When any of these characters need to appear as literal data rather than structural punctuation (for example, an email address containing "@" in a query parameter), they must be percent-encoded.

Common use cases

URL encoding is essential when building query strings dynamically, passing user-generated text as a URL parameter, embedding a full URL inside another URL (like a redirect parameter), or including non-ASCII characters such as accented letters or emoji in a URL.

Example

Encode "hello world & more"
hello world & more
hello%20world%20%26%20more

Tips

  • Spaces are encoded as %20 (or sometimes "+", depending on context — query strings traditionally use "+").
  • Encode each value individually before assembling a full query string, not the whole URL at once.

Frequently Asked Questions

What is the difference between encodeURIComponent and encodeURI?

encodeURIComponent escapes nearly all reserved characters and is meant for encoding an individual value (like a query parameter). encodeURI is meant for encoding a full URL and leaves structural characters like "/" and "?" untouched. This tool behaves like encodeURIComponent, suited for individual values.

Why does a space become %20?

%20 is the percent-encoded form of the space character's ASCII code (32 in hex is 20).