Free Tool

    URL Encoder / Decoder

    Encode special characters for safe URLs or decode percent-encoded strings instantly.

    URL Encode

    What Is URL Encoding?

    URL encoding (also called percent-encoding) replaces unsafe or reserved characters in a URL with a % sign followed by two hexadecimal digits. For example, a space becomes %20. This ensures URLs are transmitted correctly across the internet without ambiguity.

    encodeURIComponent vs. encodeURI

    encodeURIComponent encodes everything except alphanumerics and - _ . ! ~ * ' ( ). Use it for query parameters. encodeURI preserves URL-structural characters like : / ? # [ ] @, making it suitable for encoding full URLs.

    Common Use Cases

    • Encoding query string parameters containing special characters
    • Preparing strings for use in API requests and webhooks
    • Debugging percent-encoded URLs from server logs
    • Encoding file paths with spaces or unicode characters
    • Converting between URL-safe and human-readable formats

    Monitor Your APIs & Websites 24/7

    Ensure your endpoints are always reachable with Xitoring's uptime and API monitoring.

    Start Free Monitoring

    URL Encoding FAQ

    Common questions about percent-encoding, spaces and double encoding.

    Should a space be encoded as %20 or +?
    In URL paths, a space is always %20. In query strings sent by HTML forms (application/x-www-form-urlencoded), a space can also appear as +. encodeURIComponent always produces %20, which works everywhere.
    What is double encoding?
    Encoding a string that is already encoded: %20 turns into %2520, because the % sign itself gets encoded. It usually happens when two layers of code both encode the same value. Decode the string once to see whether that's what happened.
    Which characters need to be encoded?
    Inside a URL component, everything except letters, digits and - . _ ~ should be encoded. Reserved characters such as & = ? / # need encoding when they are part of a value. Non-ASCII characters are encoded as their UTF-8 bytes, so é becomes %C3%A9.
    Is my input sent to a server?
    No. Encoding and decoding run in your browser, so what you paste never leaves your device.