URL Encoder & Decoder

Percent-encode a value for a query string, or decode a messy %-escaped URL back into readable text. Nothing leaves the page.

Runs in your browser — nothing is uploaded

Encoded text

About the URL Encoder & Decoder

A URL can only contain a small set of ASCII characters. Spaces, ampersands, equals signs, accents and anything outside ASCII must be written as a percent sign followed by two hexadecimal digits for each UTF-8 byte. That is why a space becomes %20 and é becomes %C3%A9.

Encoding a value before you put it in a query string prevents a stray & or # from splitting the parameters. Decoding is the reverse: it turns logs, referrer strings and copied links back into the text a person can read.

This tool uses encodeURIComponent and decodeURIComponent, the same functions browsers use. They encode every reserved character, so use them on a single value such as a search term, not on a complete URL where the : / ? and & separators must stay as they are.

FAQ

URL Encoder & Decoder — frequently asked

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent encodes everything except letters, digits and - _ . ! ~ * ' ( ), so it is the right choice for one parameter value. encodeURI leaves the structural characters : / ? # & = + in place, so it suits a whole URL. Encoding a full URL with the component version breaks it.

Why does a space become %20 in one place and + in another?

%20 is the standard percent-encoding of a space. Some HTML form submissions and older query-string encoders use + instead, and most servers decode both. Use %20 when you build URLs yourself, because + is only a space inside application/x-www-form-urlencoded data.

Why do I get a URIError when decoding?

A lone % or a % that is not followed by two hexadecimal digits cannot be decoded, and the decoder reports an error. A common cause is a value that was already decoded and contains a literal percent sign, such as 50% off. Encode the percent sign as %25 to fix it.

Are accented letters and emoji handled correctly?

Yes. Both functions work on UTF-8 bytes, so São becomes S%C3%A3o and an emoji becomes four percent-encoded bytes. Decoding reverses that exactly, as long as the bytes are valid UTF-8.

Does encoding change the meaning of my URL parameters?

It changes the representation, not the value. A server that decodes the parameter once receives the original text. Double-encoding is the usual mistake: %2520 decodes once to %20 and then to a space only if the server decodes twice.

Is my text sent anywhere?

No. The conversion runs with JavaScript in your browser and the page does not send your input to a server, so tokens and personal data in the query string remain local.

    Report an issue