Skip to content

URL Encoder & Decoder

Percent-encode text for safe use in URLs and query parameters, or decode percent-encoded URLs back to readable text.

Runs in your browser Free, no sign-up
Loading tool workspace...

What is URL Encoder & Decoder?

This URL encode and decode tool converts text to and from percent-encoding, the format URLs use for characters that are not allowed or have special meaning. Encoding turns spaces into %20, & into %26, / into %2F and é into %C3%A9, so a value can be safely placed in a query parameter or path segment without breaking the URL.

Decoding reverses the process, turning a URL full of %XX sequences back into readable text. It is the quickest way to read tracking links, redirect URLs and API requests, or to build query strings by hand.

How to use URL Encoder & Decoder

  1. Choose Encode to percent-encode text, or Decode to turn percent-encoded text back into plain text.
  2. Paste the text or URL into the input panel.
  3. The result appears in the output panel instantly.
  4. Copy it into your URL, query string or code.

Key features

  • Percent-encodes text with encodeURIComponent (RFC 3986)
  • Decodes %XX sequences and + as space
  • Full UTF-8 support for international text and emoji
  • Clear errors for malformed percent-encoding
  • Instant output as you type
  • Runs entirely in your browser

Common use cases

  • Encoding query parameter values such as search terms, emails and redirect URLs
  • Decoding UTM-tagged and tracking links to read their parameters
  • Debugging double-encoded URLs (%2520 instead of %20)
  • Building API request URLs with special characters
  • Reading encoded values in server logs

Technical details & standards

Encoding uses JavaScript's encodeURIComponent, which follows RFC 3986: it leaves letters, digits and - _ . ! ~ * ' ( ) unchanged and percent-encodes every other character as its UTF-8 bytes. That is the right choice for individual query parameter values and path segments; encoding a whole URL this way also encodes its :// and / characters.

Decoding replaces + with a space (as in HTML form encoding) and decodes %XX sequences as UTF-8 with decodeURIComponent. Malformed sequences, such as a % not followed by two hex digits, produce a clear error instead of a partial result.

URL encode and decode in JavaScript, Python, PHP and curl

To percent-encode a value in code, use the language's component-level function, not the one for whole URLs. Each snippet encodes the same value, a b&c=d/é, to a%20b%26c%3Dd%2F%C3%A9.

JavaScript

encodeURIComponent("a b&c=d/é");               // "a%20b%26c%3Dd%2F%C3%A9"
decodeURIComponent("a%20b%26c%3Dd%2F%C3%A9");   // "a b&c=d/é"

Python

from urllib.parse import quote, unquote

quote("a b&c=d/é", safe="")          # 'a%20b%26c%3Dd%2F%C3%A9'
unquote("a%20b%26c%3Dd%2F%C3%A9")    # 'a b&c=d/é'

quote() leaves / unencoded unless you pass safe="". Use quote_plus() for form data, where a space becomes +.

PHP

rawurlencode("a b&c=d/é");               // "a%20b%26c%3Dd%2F%C3%A9"
rawurldecode("a%20b%26c%3Dd%2F%C3%A9");  // "a b&c=d/é"

urlencode() writes spaces as +, which suits form data but not URL paths.

curl

curl -G https://example.com/search --data-urlencode "q=a b&c=d/é"

-G sends the encoded value in the query string: ?q=a%20b%26c%3Dd%2F%C3%A9.

URL encoded characters

How the encoder above (encodeURIComponent) writes each special character. Letters, digits and - _ . ! ~ * ' ( ) are left as they are; everything else becomes % followed by the hex value of each UTF-8 byte.

CharacterEncodedMeaning in a URL
Space%20Also written + in form-encoded query strings
!Not encoded
"%22
#%23Starts the fragment
$%24
%%25Starts every escape sequence
&%26Separates query parameters
'Not encoded
(Not encoded
)Not encoded
*Not encoded
+%2BMeans a space in form-encoded query strings
,%2C
/%2FSeparates path segments
:%3ASeparates the scheme and the port
;%3B
<%3C
=%3DSeparates a parameter's name and value
>%3E
?%3FStarts the query string
@%40Separates user info from the host
[%5B
\%5C
]%5D
^%5E
`%60
{%7B
|%7C
}%7D
~Not encoded
é%C3%A9Non-ASCII characters are encoded as their UTF-8 bytes

Frequently asked questions

What is URL encoding?

URL encoding, or percent-encoding, replaces characters that are unsafe or reserved in URLs with % followed by two hex digits for each UTF-8 byte. A space becomes %20 and ? becomes %3F.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL but leaves reserved characters such as :, /, ?, & and = alone. encodeURIComponent encodes those too, which is what you want for a single parameter value. This tool uses encodeURIComponent.

Should a space be %20 or +?

%20 is correct everywhere in a URL. + means a space only in the query string of form submissions (application/x-www-form-urlencoded). This decoder treats + as a space, as most servers do.

What does %2520 mean?

It is a double-encoded space: % was encoded as %25, followed by 20. Decode twice to get the original, and fix the code that encodes the value twice.

What do %2F, %3D, %3A and %26 mean?

They are encoded reserved characters: %2F is /, %3D is =, %3A is :, %26 is &, %3F is ? and %23 is #. They are encoded inside a parameter value so the URL parser does not read them as separators. The table above lists every special character with its encoding.

Which characters are safe in a URL without encoding?

Letters, digits and - _ . ~ never need encoding. Reserved characters such as : / ? # [ ] @ ! $ & ' ( ) * + , ; = have a meaning in URLs, so they must be percent-encoded when they are part of a value rather than a separator. This tool uses encodeURIComponent, which also leaves ! * ' ( ) unchanged and encodes everything else, so a space becomes %20 and é becomes %C3%A9.

Is my data safe?

Processing happens locally in your browser. Tool input is not sent to CodeUnpack servers.

Does it work offline?

Once the page has loaded, this tool can process input without an internet connection.

More encoders & decoders tools

View all