URL Encode / Decode

Percent-encode URLs or decode URL-encoded strings instantly.

Advertisement

URL Encode / Decode — Percent Encoding Explained

URL encoding (also called percent-encoding) is a mechanism for encoding information in a Uniform Resource Identifier (URI). URLs can only be transmitted over the Internet using the ASCII character set. Characters outside this set — like spaces, special characters, and non-Latin letters — must be converted into a format that can be transmitted safely.

How URL Encoding Works

Each character that needs encoding is represented as a percent sign (%) followed by two hexadecimal digits. For example:

When Do You Need URL Encoding?

urlencode vs. rawurlencode

urlencode converts spaces to + and is used for form data. rawurlencode (RFC 3986) converts spaces to %20 and is the standard for URL paths and query strings. When in doubt, use rawurlencode for URLs.