Home › Developer Tools › URL Encoder Decoder

URL Encoder Decoder

Encode text for safe use in URLs, or decode %20-style percent-encoded links back to readable text. Pick component, full URL or form encoding and convert many lines at once.

Try:
Advertisement

How to use the URL Encoder Decoder

  1. Choose Encode or Decode.
  2. Pick the encoding type: Component for a single value such as a query parameter, Full URL to keep characters like / ? & = intact, or Form for HTML form data where spaces become +.
  3. Paste your text or URL. The result appears instantly. Tick "Each line separately" to convert a list.
  4. Copy the result, or press Swap to send it back to the input. The URL breakdown below shows each part and query parameter decoded.

Common URL-encoded characters

CharacterEncodedCharacterEncoded
space%20 (or + in forms)&%26
!%21=%3D
#%23?%3F
$%24@%40
%%25/%2F
+%2B:%3A
,%2Cé%C3%A9

Which encoding should I choose?

OptionUse it forExample input → output
ComponentA single query value, path segment or redirect URL inside another URLa&b=c d → a%26b%3Dc%20d
Full URLA complete URL that has spaces or non-English characters but correct structurehttps://x.com/a b?q=ü → https://x.com/a%20b?q=%C3%BC
Form dataHTML form submissions and APIs that expect application/x-www-form-urlencodedNew York → New+York

URL encoding in code

JavaScript: encodeURIComponent(value) and decodeURIComponent(value). Python: urllib.parse.quote(value, safe='') and urllib.parse.unquote(value). PHP: rawurlencode() for %20 or urlencode() for +. Always encode each query value separately before joining them with &, otherwise a value that contains & or = will break the URL.

Frequently asked questions

What is URL encoding?

URL encoding, also called percent-encoding, replaces characters that are not allowed or have a special meaning in a URL with a % followed by two hex digits. For example, a space becomes %20 and & becomes %26. Non-English characters are first turned into UTF-8 bytes, so é becomes %C3%A9.

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent encodes everything except letters, digits and - _ . ! ~ * ' ( ), so it is right for a single value inside a URL. encodeURI leaves characters that structure a URL (: / ? # [ ] @ & = + $ , ;) alone, so it is right for encoding a whole URL that is already correctly built.

Should spaces be %20 or +?

In paths and most of a URL, a space is %20. In HTML form data (application/x-www-form-urlencoded) and many query strings, a space is written as +. Choose Form encoding to use +, and tick "Decode + as space" when decoding form data.

Why do I get a malformed URI error?

Decoding fails when a % is not followed by two valid hex digits, or when the bytes are not valid UTF-8, for example "100%" or "%E0%A4%A". The tool points out the problem; encode a literal % as %25.

Is my data sent anywhere?

No. Encoding and decoding run in your browser with JavaScript, so URLs containing tokens or private parameters never leave your device.

Related tools