Tools / Developer / URL Encode/Decode
Client-side

URL Encode/Decode

Percent-encode or decode URL strings in your browser, with separate full-URL and component modes for correct query string and path handling.

What it does

  • Percent-encode and decode in both directions
  • Full URL mode keeps slashes, ? and & working
  • Component mode escapes everything but letters, digits and - . _ ~
  • UTF-8 encoding for accents, non-Latin scripts and emoji
  • Runs client-side with no data sent to any server

Spaces, ampersands and accented letters in a query string will corrupt parameters if left unencoded. This URL encoder and decoder converts text to percent-encoding and back. Type café & crème, choose Component mode, and you get caf%C3%A9%20%26%20cr%C3%A8me, ready to drop into a query parameter. Paste an encoded string and decode it to read the real value. Both directions run in a Rust module compiled to WebAssembly in your browser.

What URL encoding (percent-encoding) is

URLs may only contain a limited set of ASCII characters, so anything outside that set has to be percent-encoded. Each byte is replaced by a percent sign followed by two hexadecimal digits, which is why a space becomes %20 and an ampersand becomes %26. Characters outside ASCII are first converted to UTF-8 bytes, so é becomes two bytes, %C3%A9. The scheme is defined in RFC 3986.

How to encode or decode a URL

  1. Choose the mode: Full URL (the default) or Component. The difference is explained below.
  2. To encode, type or paste plain text into the Decoded box and click Encode. The result appears in the Encoded box.
  3. To decode, paste a percent-encoded string into the Encoded box and click Decode. The readable text appears in the Decoded box.
  4. Use the copy button next to either box to copy its content.

Full URL mode or Component mode

Some characters are reserved because they give a URL its structure: / ? # [ ] @ ! $ & ' ( ) * + , ; =. An ampersand separates query parameters, a question mark starts the query string, a hash marks a fragment. Whether those characters should be encoded depends on whether they are structure or data.

  • Full URL mode: for a complete address. Reserved characters and existing % sequences are left as they are, so https://example.com/a b?q=x&y=1 becomes https://example.com/a%20b?q=x&y=1. Encoded: spaces, control characters, non-ASCII characters and the unsafe characters " < > ` { } ^ | \.
  • Component mode: for one piece of a URL, such as a single query value or path segment. Everything except letters, digits and - . _ ~ is encoded, including &, =, /, ? and %. Use it whenever the value is user input, a search term, a filename or another URL passed as a parameter (a redirect_uri, for example).

A quick test: if the text you are encoding could contain an & that belongs to the value, use Component mode. Using Full URL mode on a single value is the classic cause of truncated query parameters.

Details and edge cases

  • Spaces become %20, not +: the encoder follows RFC 3986. HTML forms (application/x-www-form-urlencoded) use + for spaces, and the decoder leaves + unchanged, so replace + with a space before decoding form data.
  • Stricter than JavaScript: JavaScript encodeURIComponent leaves ! ' ( ) * unescaped. Component mode here encodes them too, which is always valid and safer for strict parsers such as OAuth signature checks.
  • Double encoding: a value encoded twice shows %2520 instead of %20 (the % itself became %25). Click Decode repeatedly until the text stops changing. Full URL mode does not re-encode an existing %, so it will not double-encode a URL that is already encoded.
  • Invalid input: if decoding produces bytes that are not valid UTF-8, the tool shows an error instead of garbled text. A stray % not followed by two hex digits is kept as is.
  • Same decoder in both modes: decoding turns every %XX sequence back into its character, whichever mode is selected.

Common use cases

  • Building safe links: encode user input, search terms or filenames before placing them in a query string.
  • Debugging APIs: decode a logged request URL to read the real parameter values, or encode a value to reproduce a failing call with curl.
  • OAuth and redirects: encode a full callback URL as a redirect_uri parameter in Component mode.
  • Reading tracking links: decode UTM parameters and nested URLs in marketing links to see where they really point.

Compared with code and the command line

In JavaScript you would call encodeURIComponent() or encodeURI(), in Python urllib.parse.quote(), and in a shell curl --data-urlencode or jq -rR @uri. Each has its own default set of safe characters, which is where bugs come from. This page shows the result side by side with the original, with two clearly defined modes, and no code to write.

Privacy: encoding happens locally

URLs often carry session tokens, API keys in query strings, internal hostnames and personal identifiers such as email addresses. This tool encodes and decodes entirely client-side using WebAssembly, so the text you paste is never uploaded, logged or stored on any server. It works offline once the page is loaded.

Frequently asked questions

What is the difference between URL encoding and percent-encoding?
None. Percent-encoding is the technical name in RFC 3986, URL encoding is the common one.
Should a space be %20 or +?
%20 is correct anywhere in a URL. + only means a space in form-encoded query strings. This tool always produces %20.
Which mode should I use for a query parameter value?
Component mode. It encodes &, = and ? so they stay part of the value instead of splitting it.
Why does my URL contain %2520?
It was encoded twice: %20 was encoded again and its % became %25. Decode it twice to get the original text.
Does it handle emoji and non-Latin characters?
Yes. Characters are encoded as UTF-8 bytes, so an emoji becomes four percent-encoded bytes and decodes back to the same emoji.
Is my data sent to a server?
No. Encoding and decoding run in your browser via WebAssembly.

Related tools

For escaping characters in HTML markup rather than URLs, use the HTML entity encoder and decoder. When you need to encode arbitrary data as text, the Base64 encoder and decoder is the right choice, and the JWT decoder pairs well when a token appears in a query string. To share an encoded link on paper or a screen, turn it into a code with the QR code generator.