URL Encoder/Decoder
Encode and decode URLs to ensure they are safe for the web
What is URL Encoding (Percent-encoding) and Why is it Necessary?
URLs were originally designed to use only a limited subset of ASCII characters. "Reserved" characters (like spaces, accents, or symbols like & and ?) either have special meanings or are simply forbidden. URL Encoding solves this by replacing these characters with a percentage sign (%) followed by their corresponding hexadecimal value (based on the RFC 3986 specification).
encodeURI vs. encodeURIComponent: What's the difference?
Developers often confuse these two native JavaScript methods:
- Component (encodeURIComponent): This is the more aggressive mode. It encodes almost everything, including
/,?, and&. Use this to encode parameter values within a query string so they don't break the URL structure. - Full URL (encodeURI): This preserves characters that are part of the URL structure (like
http://, slashes, and question marks). Use this mode when you want to encode an entire URL that contains invalid characters like spaces or non-ASCII symbols, keeping it navigable.
Why do spaces become %20 or +?
In standard URL encoding (RFC 3986), a space is represented by %20. However, in HTML forms (application/x-www-form-urlencoded), spaces are commonly replaced by a + sign. Our tool defaults to the %20 standard for maximum compatibility with modern web APIs.
Privacy Guaranteed
At Octovelo, encoding and decoding occur instantaneously within your browser. No URLs or data you paste here are ever sent to our servers. This is especially important when handling URLs that contain access tokens or sensitive information.