URL Encode & Decode

URL encode text so it can be used safely in links and query strings, or URL decode %20-style strings back to readable text. Unicode and emoji are encoded as UTF-8.

0 chars
0 chars

Options

Changes apply instantly.

How URL encoding works

Percent-encoding

Characters that are not allowed in a URL are replaced by % followed by two hex digits, so a space becomes %20 and & becomes %26.

Unicode as UTF-8

Non-ASCII characters are first converted to UTF-8 bytes, and each byte is encoded: ø becomes %C3%B8.

Value or full URL

Encode a single query value to escape &, = and /. Encode a full URL to keep its structure and only fix spaces and special characters.

Spaces: %20 or +

HTML forms send spaces as +. Everywhere else in a URL, %20 is the safe choice.

URL encoding reference

Letters, digits and - _ . ~ never need encoding. The "Query value" option encodes every character in this table; the "Full URL" option keeps the ones that give a URL its structure.

CharacterEncoded"Full URL" optionMeaning in a URL
space%20encodedNot allowed in URLs. Form data uses + instead.
"%22encodedNot allowed in URLs.
#%23kept as-isStarts the fragment – everything after it is not sent to the server.
%%25encodedStarts an encoded byte, so a literal percent sign must be encoded.
&%26kept as-isSeparates query parameters.
+%2Bkept as-isMeans a space in form-encoded query strings.
/%2Fkept as-isSeparates path segments.
:%3Akept as-isEnds the scheme (https:) and separates host and port.
=%3Dkept as-isSeparates a parameter name from its value.
?%3Fkept as-isStarts the query string.
@%40kept as-isSeparates user info from the host.
ø%C3%B8encodedNon-ASCII: one %XX per UTF-8 byte.
€%E2%82%ACencodedThree UTF-8 bytes.
😀%F0%9F%98%80encodedEmoji take four UTF-8 bytes.

Frequently asked questions

What is URL encoding?

URL encoding, also called percent-encoding, replaces characters that have a special meaning or are not allowed in URLs with a % sign and their hexadecimal byte value.

Why does my URL decode fail?

Decoding fails when the text contains a % that is not followed by two hex digits, or a byte sequence that is not valid UTF-8. A literal percent sign must be encoded as %25.

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent (the "query value" option) also encodes reserved characters like / ? & =. encodeURI (the "full URL" option) leaves them alone so the URL keeps working.

How do I URL decode a string?

Switch to Decode and paste the encoded text. With "Query value" selected the result matches JavaScript's decodeURIComponent(). Turn on "Spaces as +" to decode form data the way PHP's urldecode() does.

Why does my URL contain %2520?

It has been encoded twice. %25 is an encoded percent sign, so %2520 is an already-encoded %20 that was encoded again. Decode it twice to get the original text, and make sure your code encodes each value only once.

Which characters don't need URL encoding?

The unreserved characters: A–Z, a–z, 0–9 and - _ . ~. Everything else is either reserved for URL syntax (like / ? # &) or not allowed, and must be encoded when it appears inside a value.