URL Encode and Decode

URL encoding replaces unsafe characters with a % and two hexadecimal digits. A space becomes %20, & becomes %26 and é becomes %C3%A9. For example "a b&c" encodes to a%20b%26c. This keeps the address valid when it is sent over the internet.

Inputs

Paste what you want to convert.
Result
–

Results are calculated in your browser for convenience. Double-check important figures before relying on them.

What is URL encoding?

Web addresses can only contain a limited set of characters: letters, digits and - _ . ~. Other characters, including spaces, accents and symbols with special meaning such as ? & = #, must be written as percent-encoding: a % followed by the character's byte value in hexadecimal. Non-English letters are first converted to UTF-8 bytes.

CharacterEncodedCharacterEncoded
space%20#%23
&%26/%2F
=%3D?%3F
é%C3%A9+%2B

Component or whole URL?

Encode a component (such as the value of a query parameter) with the full encoder, which also converts / ? & = and #, because they would otherwise break the structure of the address. Encode a whole URL with the lighter option that keeps those characters, and only fixes spaces and other unsafe characters.

Example: the query value "cats & dogs" must become cats%20%26%20dogs inside ?q=, or the & would start a new parameter.

Decoding and common problems

  • Decoding turns %20 back into spaces, and + signs in form data into spaces.
  • Never encode twice: %20 would become %2520.
  • If decoding fails, the text may contain a stray % that is not followed by two hex digits.

For data inside text, see Base64 encoding. Everything runs in your browser; your text is not sent to us.

Common mistakes with URLs

Encode only once, and encode the individual values rather than the whole query string when you build a link by hand. If a web address contains spaces or symbols and does not work, encoding the values usually fixes it. When you copy a link from a browser, it may already be encoded, so decode it first if you want to read it.

Complete guide to the URL Encode and Decode

How to use the URL Encode and Decode, step by step

  1. Choose encode or decode.
  2. Choose component or whole URL.
  3. Paste the text.
  4. Read and copy the result.

Common mistakes to avoid

  • Double encoding.
  • Using the whole-URL option for a single value.
  • Leaving a stray % in text to decode.

Key terms explained

Percent-encoding
Writing characters as %XX.
Query string
The part of a URL after the ?.
Component
One piece of a URL, such as a value.
UTF-8
How non-English characters become bytes.

Frequently asked questions

What does %20 mean in a URL?

%20 is the percent-encoded form of a space character. The byte value of a space is 32, which is 20 in hexadecimal.

What is the difference between encodeURI and encodeURIComponent?

encodeURI keeps characters such as / ? & = # so a whole URL stays valid. encodeURIComponent encodes them too, for single values.

Why does + sometimes mean a space?

In form data (application/x-www-form-urlencoded) a plus sign stands for a space, while %20 works everywhere.

How do I encode non-English characters?

They are converted to UTF-8 bytes, and each byte is written as %XX.

Is my text uploaded?

No. The conversion happens entirely in your browser, so the text you enter is never uploaded or stored on our servers.

Related calculators

Guides worth reading