URL Encoder & Decoder

Encode special characters for use in URLs, or decode percent-escaped strings back to readable text. Two modes for different use cases.

Output
Output appears here.
What is URL encoding?

The short version

URLs only allow a limited character set. Anything outside that β€” spaces, special punctuation, non-ASCII letters β€” must be percent-encoded: each byte is replaced with %XX where XX is its hex value.

Example: "hello world" becomes "hello%20world".

Component vs Full URI β€” which mode?

  • Component mode (encodeURIComponent): escapes everything reserved including / ? & = # +. Use this when you're encoding a single value that will go inside a URL (a query-string value, a path segment, a form field).
  • Full URI mode (encodeURI): leaves URL-structural characters alone. Use this when you have a whole URL with weird characters mixed in and you don't want the slashes and question marks escaped.

If you're not sure, use Component β€” it's almost always what you want.

Common confusion

  • Plus signs: in query strings, + historically meant a space. Modern encodeURIComponent doesn't produce +, but if you're decoding something that contains +, those may represent spaces.
  • Double-encoding: if you encode an already-encoded string, you get %2520 instead of %20. Decoding once gives you back %20; decoding twice gives the original space.