URL Encoder / Decoder

Encode special characters for safe URL use or decode percent-encoded URLs. Instant, browser-based, no sign-up.

url-encoder.js — RankStreak
Input ready
Output waiting
Output will appear here...
Ready — enter a URL and click Encode or Decode

What is URL Encoding?

URL encoding (percent-encoding) converts characters not allowed in URLs into a format that can be transmitted safely. Special characters like spaces, &, =, ?, # are replaced with a % sign followed by their hexadecimal code. For example, a space becomes %20.

When to Use URL Encoding

URL Encoding in Different Languages

Every major programming language has built-in URL encoding functions. In JavaScript, use encodeURIComponent() for query parameter values or encodeURI() for full URLs. In Python, use urllib.parse.quote(). In PHP, use urlencode() for form data or rawurlencode() for path segments.

Common Characters and Their URL-Encoded Values

When Not to URL Encode

The unreserved characters A–Z, a–z, 0–9, hyphen (-), underscore (_), period (.), and tilde (~) should never be encoded. Encoding these characters unnecessarily can cause issues with some servers and is considered incorrect practice according to RFC 3986.

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?
encodeURI preserves URL structure characters like /, :, ?, #. encodeURIComponent encodes everything — use it for individual query parameter values.
Why is a space sometimes + instead of %20?
HTML forms use application/x-www-form-urlencoded which encodes spaces as +. Standard percent-encoding uses %20. Both are valid in different contexts.