URL Encoder

Percent-encode text so it can be safely embedded in URLs, query strings, and form data.

URL Encoder

Encode text for safe use in URLs and query parameters.

💡 About URL Encoding

URL encoding (percent-encoding) makes text safe for use in URLs by converting special characters.

Common use cases:

  • Query parameters with special characters
  • API endpoint paths with user input
  • Form data submission
  • Safe transmission of text via URLs

Characters encoded: Spaces become %20, & becomes %26, etc.

What is URL Encoding?

URL encoding (also called percent-encoding) replaces characters that are unsafe or have special meaning in URLs with a % sign followed by the character's two-digit hexadecimal byte value. For example, a space becomes %20 and an ampersand becomes %26.

RFC 3986 defines which characters are "unreserved" (A–Z, a–z, 0–9, -, _, ., ~) and safe to use literally; all other characters must be percent-encoded to prevent misinterpretation by browsers, servers, and intermediate proxies.

Common Use Cases

Query String Parameters: Encode values passed as key=value pairs so that special characters like &, =, and ? are not mistaken for URL delimiters. Form Submissions: HTML forms with method="POST" send data as application/x-www-form-urlencoded, requiring all field values to be percent-encoded. File Path Encoding: Encode file names or directory segments that contain spaces or Unicode characters before embedding them in a URL path. OAuth and API Authentication: Signature bases in OAuth 1.0 require every component — including already-encoded values — to be double-encoded.


Tips

Encode only the value portion of a URL, not the entire URL — encoding the scheme or slashes will break the link structure. Spaces may appear as either %20 or + depending on context; %20 is correct for path segments, while + is specific to application/x-www-form-urlencoded form data. Multi-byte Unicode characters (e.g., emoji or accented letters) are first encoded as UTF-8 bytes, then each byte is percent-encoded individually.


Share on
Share on FacebookShare on XShare on LinkedIn
Did you find this page useful?