URL Encoder and Decoder: Percent-Encode and Decode URLs

Encode text so that it is safe inside a web address, decode percent codes such as %20 back to readable text, or paste a full URL to see its protocol, host, path and every query parameter. Works in your browser, with nothing uploaded.

Related Tools

Base64 Encoder & Decoder JSON Formatter & Validator URL Slug Generator Hash Generator (MD5, SHA-256) Unix Timestamp Converter All Utilities

What is URL encoding?

A web address can only contain a limited set of characters: letters, digits and a few symbols. Spaces, accented letters, emoji and symbols with special roles, such as ampersand, question mark and hash, must be replaced with a percent sign followed by two hexadecimal digits. This is called URL encoding or percent encoding. A space becomes %20, and the ampersand becomes %26.

Without encoding, a value such as rock & roll in a query string would be cut at the ampersand, and the address could break or change meaning. Encoding keeps every part of the address unambiguous, so browsers, servers and APIs read it the same way.

How to encode and decode a URL

  1. Choose an action: encode a parameter value, encode a full URL, or decode.
  2. Paste your text or URL into the input box.
  3. Press Convert and read the result below.
  4. If the input is a full URL, the parser at the bottom lists its parts and parameters.
  5. Copy the result.

encodeURIComponent or encodeURI?

These are the two standard JavaScript methods, and the difference matters. Encode a parameter value, which uses encodeURIComponent, converts every special character, including slash, question mark, ampersand and equals. Use it for a single piece of data that goes inside a query string, such as a search term.

Encode full URL, which uses encodeURI, leaves the characters that give a URL its structure alone, such as colon, slash, question mark, ampersand and hash. Use it when you have a whole address that contains spaces or non-English letters. If you use it on a value, an ampersand in the value will not be encoded and will split your parameter.

Plus signs and spaces

In a path, a space is encoded as %20. In HTML form data and many query strings, a space can also appear as a plus sign. When decoding, this tool treats a plus sign as a space, which is the right choice for query strings. If you need a literal plus sign, it appears as %2B in encoded text.

Common uses

  • Building links with search terms, names or email addresses in the query string.
  • Debugging API calls and redirects with long encoded parameters.
  • Reading tracking links and campaign parameters.
  • Fixing links that break because they contain spaces or non-English characters.
  • Decoding a copied link to see what it really contains.

Errors when decoding

Decoding fails when a percent sign is not followed by two valid hex digits, or when the bytes do not form valid text. A stray percent sign in plain text is a typical cause. Encode it as %25 first, or fix the broken code and try again.

Common characters and their URL encoding

Character Encoded
Space %20
& (ampersand) %26
= (equals) %3D
? (question mark) %3F
# (hash) %23
/ (slash) %2F
+ (plus) %2B
% (percent) %25
@ (at sign) %40
é (e with acute accent) %C3%A9

Frequently Asked Questions

What does %20 mean in a URL?

It is an encoded space. %20 is the percent code for the space character.

How do I URL encode a string?

Paste it, choose Encode, and press Convert. Use the parameter option for values and the full URL option for whole addresses.

How do I decode a URL?

Choose Decode, paste the encoded text and press Convert.

What is the difference between encodeURI and encodeURIComponent?

encodeURI keeps characters that structure a URL. encodeURIComponent encodes them too, so it is safer for single values.

Why is my plus sign decoded as a space?

In query strings a plus sign stands for a space. A literal plus sign should be written as %2B.

Does it support non-English characters?

Yes. They are encoded as UTF-8 byte sequences, such as %C3%A9 for the letter e with an acute accent.

Is my URL sent anywhere?

No. Encoding, decoding and parsing happen in your browser.