URL Encoder & Decoder
Encode and decode URLs, query strings, and special characters.
O resultado aparecerá aqui
Digite algo no campo de entrada
encodeURIComponent
Codifica todos os caracteres especiais, incluindo / ? : @ & = + $ #
Use para: valores de query params, fragmentos de URL
encodeURI
Preserva caracteres válidos em URLs: / ? : @ & = + $ #
Use para: URLs completas que já têm estrutura válida
encodeURIComponent vs encodeURI — which one you actually need
Use encodeURIComponent for values inside query parameters — it encodes characters like /, ?, &, =, and # that have structural meaning in URLs. Use encodeURI only when encoding a complete URL where those structural characters should be preserved.
If you're building a redirect URL like /redirect?next=/dashboard?tab=settings, the inner URL must be encoded with encodeURIComponent — otherwise the outer parser splits on the inner ? and = and breaks the redirect. encodeURI is for when you have a complete URL with a known structure and only want to handle non-ASCII characters like spaces or accented letters.
When Base64 encoding is the right choice for URL-safe data transmission
Base64 is not URL encoding — it's binary-to-text encoding. Use it when you need to transmit binary data, arbitrary strings, or JSON objects through a URL parameter without worrying about character escaping.
A common pattern: encode a JSON token or a binary ID as Base64 for use in a URL parameter, then decode it server-side. Base64 uses +, /, and = which are not URL-safe — for URL parameters, use Base64url encoding (which replaces + with - and / with _) or URL-encode the Base64 string afterward. This tool handles the encoding; verify the output works in your target context.
Special characters that break URLs — and exactly how they're encoded
Space becomes %20 (or + in form encoding), & becomes %26, = becomes %3D, ? becomes %3F, / becomes %2F, @ becomes %40, # becomes %23. These are percent-encoded as hex values of their ASCII bytes.
The characters that cause the most URL issues are the structural delimiters: &, =, ?, and # have specific roles in URL syntax. If a query parameter value contains any of these, it must be encoded or the URL parser will misinterpret the structure. Percent-encoding replaces each byte with %XX where XX is the uppercase hexadecimal value. This is what encodeURIComponent does for every character except letters, digits, -, _, ., and ~.
Encoding URL parameters when building API requests and webhook URLs
When constructing API requests programmatically, always encode parameter values with encodeURIComponent before concatenating them into the URL string — even if the value 'looks safe'. Strings that contain user input almost certainly contain characters that break URL parsing.
A common bug: a user enters an email address with a + sign (common in Gmail aliases like [email protected]). If you concatenate that directly into a query string, the + is interpreted as a space by many URL parsers. Always encode. For webhook URLs that include callback URLs as parameters, double-encoding is often required: encode the callback URL first, then encode the result as a parameter value.

