Loading calculator...
Loading calculator...
URL encode or decode text using encodeURIComponent / decodeURIComponent. Handles Unicode characters, spaces, and special symbols.
URL Encoding Rules:
Unreserved characters (A-Z, a-z, 0-9, -, _, ., ~) are not encoded.
All other characters are percent-encoded as %XX (hex byte values).
Space becomes %20 (encodeURIComponent) or + (application/x-www-form-urlencoded)
URL encoding (percent-encoding) converts characters that are not allowed in URLs into a percent sign followed by two hexadecimal digits representing the character's byte value. For example, a space becomes %20.
encodeURI encodes a full URL and does not encode characters that have special meaning in URLs (, /, ?, #, etc.). encodeURIComponent encodes everything except unreserved characters, making it suitable for encoding individual query parameter values.
The + sign for spaces is used in the application/x-www-form-urlencoded format (HTML form submissions). The %20 encoding is used in URL paths and by encodeURIComponent. Both are valid in query strings but %20 is more universally correct.
Unreserved characters that need no encoding: A-Z, a-z, 0-9, hyphen (-), underscore (_), period (.), tilde (~). Characters like /, ?, #, &, = have special meaning in URLs and must be encoded when used as data.
URLs can only contain ASCII characters. Non-ASCII characters (like cafe with an accent) are first encoded as UTF-8 bytes, then each byte is percent-encoded. 'e with acute' (U+00E9) encodes as %C3%A9.
A query string is the part of a URL after the ? character. It contains key=value pairs separated by & characters. Values in query strings should be URL-encoded to avoid ambiguity with special characters.