URL Encoder / Decoder

Input
Result

01 Definition

URL encoding (also known as Percent-encoding) is a mechanism for encoding information in a Uniform Resource Identifier (URI) under certain circumstances. It ensures that characters which are not allowed in URLs are converted into a safe format.

Why Encode?

URLs can only contain a limited set of characters (alphanumeric and -_.~).

Any other characters (like spaces, &, ?, =) must be encoded to prevent server errors or parsing ambiguity.

02 How it Works

Unsafe characters are replaced with a % followed by two hexadecimal digits. These digits represent the byte value of the character in the active character set (usually UTF-8).

Character (space) / ?
ASCII Hex 20 2F 3F
URL Encoded %20 %2F %3F

03 Usage Scenarios

  • Query Parameters When search terms contain spaces or symbols: q=hello world becomes q=hello%20world.
  • Redirect URLs When passing a URL inside another URL parameter, ensuring characters like `?` or `&` don't break the parent URL.
  • Non-ASCII Filenames Encoding filenames with special or non-English characters for safe download links.

FAQ

Space: %20 or + ?
In standard URI encoding, a space should be %20. However, in legacy form submissions (application/x-www-form-urlencoded), spaces are often replaced with +. This tool produces standard %20.
encodeURI vs encodeURIComponent?
encodeURI is for full URLs; it ignores special characters like : / ? # & =.
encodeURIComponent is for URL parameters; it encodes almost everything (including / ? &) to ensure data integrity.
This tool defaults to encodeURIComponent for maximum safety.
Does it support Unicode/Emoji?
Yes. Unicode characters are first converted to UTF-8 bytes, and then each byte is percent-encoded.
Is there a URL length limit?
The HTTP spec doesn't limit length, but browsers and servers do. For best compatibility (esp. with older IE versions), keep URLs under 2,000 characters. Modern browsers support much more.
Is my data sent to a server?
No. This tool runs 100% in your browser using Client-side JavaScript. Your data never leaves your device.

More Free Tools