Skip to content

URL Encode

Percent-encode a string for URLs.

Input
Output

No result

About URL Encode

Percent-encoding replaces characters that are not safe to carry inside a URL with a % sign followed by two hexadecimal digits — a space becomes %20, an ampersand becomes %26, and a non-ASCII character expands into the UTF-8 bytes that represent it. It is the mechanism that lets arbitrary text travel inside something as structurally strict as a URL.

The reason it is needed is that URLs already use a set of characters for their own syntax. ? starts a query string, & separates parameters, # starts a fragment, / divides path segments. If the value you are sending contains any of those characters literally, it will be read as syntax rather than data and the request will arrive scrambled or truncated.

This is one of the cases where you should encode deliberately rather than guessing. A value that looks fine will often break only when a user pastes something containing an ampersand or a hash — which is exactly the input that is hardest to reproduce after the fact.

One setting is offered and it is not adjustable: everything outside the unreserved set is encoded. There is no encode-only-these-characters mode, no choice between the path, query and fragment safe-lists, and no option to leave slashes in place so a nested URL stays legible — the slash is encoded along with everything else. The result is also not checked back against the URL you intend to build, so the page will not tell you whether the output is safe in the position you have in mind, nor can it decode a value for you; that is a separate tool.

How to use URL Encode

  1. 1 Paste the value you are going to send — for example a search term, an email address, or a full URL you are passing as a parameter.
  2. 2 The percent-encoded form appears immediately, with non-ASCII characters expanded to their UTF-8 byte sequences.
  3. 3 Copy the output and use it directly in your query string.

Frequently asked questions

What does a space become?

%20. You will also see a plus sign used for spaces in form submissions, but that convention only applies to application/x-www-form-urlencoded bodies — inside a URL path or query string, %20 is the correct form.

Should I encode a whole URL before passing it as a parameter?

Yes, and that is precisely where this is most often needed. If the value you are passing contains its own ? or &, those would otherwise be read as belonging to the outer URL. Encoding the inner URL first keeps its structure contained as a single value.

Which characters are left alone?

Unreserved characters — letters, digits, and the few punctuation marks that carry no special meaning in a URL, such as the hyphen, underscore and tilde. Everything else is replaced by its percent-encoded form.

Why did my Chinese text turn into a long run of percent signs?

Because it was first converted to UTF-8, and each Chinese character occupies three UTF-8 bytes — each of which becomes its own %XX triplet. The result looks long but decodes back to exactly what you started with.

Free, online, and private

Free to use

URL Encode is completely free. There is no account to create, no login, and no hidden charge or usage limit.

Runs online in your browser

It is a free online tool that runs entirely in your browser. Nothing to download or install — open the page and start using it right away.

Your data stays private

All processing happens locally on your device. Your input is never uploaded, stored, or tracked, so it never leaves your browser.

How URL Encode behaves in detail

These are the specifics of this implementation — the exact ranges, defaults and fixed settings you are working with.

Parameter Value
Method encodeURIComponent — the component-level escape
Characters escaped everything except A-Z a-z 0-9 - _ . ! ~ * ' ( )
Encoding UTF-8 bytes, each percent-escaped
Multibyte input handled — a CJK character becomes three %XX escapes

Compiled from the implementation of this tool and checked against it by itoolnet.

What URL Encode does not do

Knowing the edges of a tool saves more time than another list of its features. These are the cases where it will not do what you might expect.

  • This is the component encoder, and the distinction matters. Because it escapes : / ? # & = and +, a complete URL put through it stops being a valid URL — the scheme separator is encoded along with everything else.
  • It is one-directional. Decoding a percent-encoded string back to readable text is what the URL Decoder does.

Tested and documented by itoolnet, the team that builds and maintains this site.

Share & embed this tool

Writing a guide or article? You are welcome to link to URL Encode with the snippet below. It is free, runs entirely in your browser, and needs no signup.