Skip to main content

    URL Encoder & Decoder

    Encode or decode URLs and query parameters. Supports encodeURI and encodeURIComponent.

    Free to use. Runs in your browser.

    Paste a URL to percent-encode special characters for safe transmission, or decode an encoded URL back to readable form. Handles both component and full-URI encoding.

    Common Encodings

    Space%20
    &%26
    =%3D
    ?%3F
    /%2F
    #%23
    +%2B
    @%40

    Why URLs Need Encoding

    URLs can only contain a limited set of characters: letters, numbers, and a few special characters like hyphens and underscores. Everything else, spaces, ampersands, question marks, non-ASCII characters, must be "percent-encoded" to travel safely through browsers, servers, and APIs.

    Percent-encoding replaces each unsafe character with a % followed by two hex digits. A space becomes %20. An ampersand becomes %26. The Japanese character "東" becomes %E6%9D%B1. It's the postal code of the web, ensuring your data arrives at the right destination without corruption.

    This matters more than you think. A URL with an unencoded & in a query parameter can break the entire request. An unencoded space might silently truncate your data. URL encoding prevents these bugs before they happen.

    Characters That Need Encoding

    CharacterEncodedWhy It's Reserved
    Space%20 (or +)Separates URL segments
    &%26Separates query parameters
    =%3DSeparates key from value in params
    ?%3FMarks start of query string
    #%23Marks fragment/anchor
    /%2FSeparates path segments
    @%40Used in email/authentication URLs
    +%2BInterpreted as space in form data

    What this means for you: If you're building URLs dynamically (API calls, redirects, tracking links), always encode parameter values. Most programming languages have built-in functions: encodeURIComponent() in JS, urllib.parse.quote() in Python, URLEncoder.encode() in Java.

    encodeURI vs encodeURIComponent

    encodeURI()

    Encodes a full URL but leaves reserved characters (: / ? # @ & = +) intact. Use it when you have a complete URL with spaces or non-ASCII characters in the path.

    encodeURIComponent()

    Encodes everything except letters, digits, and - _ . ~. Use it for individual query parameter values. This is what you need 90% of the time.

    Common Encoding Mistakes

    Bug

    Double encoding

    Encoding an already-encoded string turns %20 into %2520. This happens when a framework auto-encodes and you've already encoded manually. Decode first, or let only one layer handle encoding.

    Bug

    Encoding the full URL instead of just the value

    Using encodeURIComponent() on an entire URL turns the :// into %3A%2F%2F, breaking the link. Use encodeURI() for full URLs, encodeURIComponent() for individual parameter values only.

    Bug

    Space as + vs %20

    HTML forms encode spaces as +, but URLs use %20. If you're building a URL from form data, replace + with %20. Most modern APIs expect %20, but some legacy systems still expect +.

    Related Tools

    How to use this tool

    1

    Paste a URL or encoded string

    2

    Choose Encode (Component or URI) or Decode

    3

    Copy the result

    Common uses

    • Encoding query parameter values for API calls
    • Decoding percent-encoded URLs for debugging
    • Preparing redirect URLs with special characters
    • Encoding form data for POST requests
    • Making URLs safe for sharing and bookmarking

    Share this tool

    Frequently Asked Questions

    What is URL encoding?
    URL encoding (percent-encoding) replaces unsafe characters with a '%' followed by two hex digits. A space becomes %20, an ampersand becomes %26, and a question mark becomes %3F. Without encoding, these characters break URLs because they have special structural meaning.
    What's the difference between encodeURI and encodeURIComponent?
    encodeURI() encodes a complete URL but leaves structural characters (: / ? # @ & = +) intact. encodeURIComponent() encodes everything except letters, digits, and - _ . ~. Use encodeURIComponent() 90% of the time, it's what you need for query parameter values.
    Why does my URL break when I don't encode it?
    Characters like &, =, ?, and # have special meaning in URLs. An unencoded & in a query value gets interpreted as a parameter separator. An unencoded # truncates everything after it. Encoding prevents the browser from misinterpreting data characters as structural ones.
    Should I encode the entire URL or just parts of it?
    Encode individual parameter values, not the entire URL. If you encode the whole thing, you'll break the protocol (://), path separators (/), and query delimiters (?&=). Use encodeURIComponent() on each value, then build the URL from encoded parts.
    What's the difference between %20 and + for spaces?
    Both represent a space, but in different contexts. %20 is the standard URL encoding. + is used in application/x-www-form-urlencoded format (HTML form submissions). encodeURIComponent() produces %20. URLSearchParams produces +. Most servers accept both.
    How do I encode URLs in JavaScript?
    Use encodeURIComponent() for parameter values: 'key=' + encodeURIComponent(value). For building full URLs with multiple parameters, use the URL and URLSearchParams APIs: new URL('https://example.com'); url.searchParams.set('q', 'hello world').
    Can URL encoding handle Unicode and emojis?
    Yes. Unicode characters get encoded as their UTF-8 byte sequences. The emoji 'πŸŽ‰' becomes %F0%9F%8E%89 (four bytes). Non-Latin characters work the same way, '東京' becomes %E6%9D%B1%E4%BA%AC. Modern browsers handle this automatically in the address bar.
    Is double-encoding a problem?
    Yes, and it's a common bug. If you encode an already-encoded string, %20 becomes %2520 (the % gets encoded to %25). Always encode raw values, never pre-encoded strings. If you're seeing %25 in your URLs, you're double-encoding somewhere.
    What characters don't need encoding in URLs?
    Unreserved characters are safe without encoding: A-Z, a-z, 0-9, hyphen (-), underscore (_), period (.), and tilde (~). Everything else either has a reserved meaning or could cause problems and should be encoded.
    How does URL encoding work in different programming languages?
    JavaScript: encodeURIComponent(). Python: urllib.parse.quote(). Java: URLEncoder.encode(str, 'UTF-8'). PHP: urlencode(). Ruby: CGI.escape(). Go: url.QueryEscape(). C#: Uri.EscapeDataString(). Each handles the standard slightly differently, check which characters each function encodes.
    Is this tool private?
    Completely. All encoding and decoding runs in your browser using JavaScript's built-in encodeURIComponent() and decodeURIComponent() functions. Nothing is sent to any server. Your data stays on your device.
    What's the maximum URL length I can use?
    The HTTP spec has no limit, but browsers do. Chrome supports ~2MB in the address bar. Internet Explorer was famously limited to 2,083 characters. For API calls, most servers cap at 8KB for URLs. If your URL is extremely long, consider using POST with a request body instead.

    Results are for general informational purposes only and should be checked before use. They are not professional advice. See our Disclaimer and Terms of Service.