URL Encode / Decode Online Free

Percent-encode a URL or query string, or decode %XX sequences back to readable text. Choose between encodeURIComponent (query params) and encodeURI (full URLs). Runs in your browser.

Common Percent-Encoded Characters

Character Encoded Notes
Space%20 or ++ only valid in form data
&%26Separates query params
=%3DSeparates key=value
+%2BLiteral plus sign
/%2FPath separator (encoded in params)
#%23Fragment identifier
?%3FQuery string start
@%40Used in email addresses

What Is URL Encoding?

URL encoding (also called percent-encoding) converts characters that are not allowed or have special meaning in URLs into a safe format. Each unsafe character is replaced with a % sign followed by two hexadecimal digits representing the character's UTF-8 byte value. For example, a space becomes %20 and & becomes %26.

URLs can only contain a limited set of ASCII characters. Spaces, accented letters, Chinese characters, and special symbols must all be encoded before they appear in a URL — otherwise browsers and servers may misinterpret them.

encodeURIComponent vs encodeURI

encodeURIComponent encodes everything except: A–Z a–z 0–9 - _ . ! ~ * ' ( ). Use this for individual query parameter values. It will encode /, ?, #, &, and = — characters that are meaningful delimiters in a URL.

encodeURI preserves the structural characters of a complete URL: : / ? # [ ] @ ! $ & ' ( ) * + , ; =. Use this when encoding an entire URL that already has its structure in place — it won't break the path separators or query string delimiters.

When Do You Need URL Encoding?

  • Building API requests: Query parameters that contain user input must be encoded so special characters don't break the URL structure.
  • Redirects and links: If a URL appears inside another URL (as a redirect parameter), it must be encoded.
  • Internationalized URLs: Any non-ASCII characters in paths or parameters (accented letters, Chinese, Arabic, emojis) must be percent-encoded.
  • Debugging: Decode a percent-encoded URL to read it in plain text when troubleshooting API calls or redirects.

URL Encoding vs HTML Encoding

URL encoding uses %XX sequences for unsafe characters. HTML encoding (HTML entities) uses &, <, etc. for characters that would break HTML markup. They solve different problems and should not be confused.

Frequently Asked Questions

What is the difference between %20 and + for spaces? +
%20 is the standard percent-encoding of a space and is valid in any part of a URL. The + sign represents a space only in application/x-www-form-urlencoded data (HTML form POST bodies and query strings from HTML forms). In path segments, + is a literal plus sign, not a space.
Which function should I use for query parameters? +
Use encodeURIComponent for individual query parameter values. It encodes characters like &, =, /, and ? that would otherwise be interpreted as URL structure. Never put raw user input into a URL without encoding it first.
Why doesn't encodeURI encode the @ sign? +
encodeURI is designed to encode a complete, structurally valid URL. Characters like @ are allowed in URLs (used in authority sections like user@host) so encodeURI leaves them alone. Use encodeURIComponent if @ appears inside a parameter value.
Is my data safe? +
Yes. All encoding and decoding happens locally in your browser. No data is sent to a server or logged anywhere.