Back to Free Tools

URL Encoder / Decoder

Encode and decode URL parameters

Common URL Encodings

space%20
!%21
#%23
$%24
&%26
'%27
(%28
)%29
*%2A
+%2B
,%2C
/%2F
:%3A
?%3F
@%40
=%3D

URI Component: Encodes all special characters including /, ?, #, etc. Use for encoding query parameters.

Full URI: Preserves URL structure characters like /, ?, #. Use for encoding complete URLs.

Free Online URL Encoder & Decoder

Encode and decode URLs and URI components instantly with our free online URL encoder/decoder tool. URL encoding (also known as percent encoding) converts special characters into a format that can be safely transmitted in URLs without causing parsing issues.

URLs can only contain a specific set of characters. When you need to include special characters, spaces, or non-ASCII characters in a URL, they must be percent-encoded. Each problematic character is replaced with a % followed by its hexadecimal value. For example, a space becomes %20.

Our tool supports both URI component encoding (for query parameters) and full URI encoding (for complete URLs). Understanding the difference is crucial for proper URL handling in web development.

URI Component vs Full URI Encoding

URI Component (encodeURIComponent)

Encodes everything except: A-Z a-z 0-9 - _ . ! ~ * ' ( )

Use for:

  • Query parameter values
  • Path segments
  • Form data (when building URLs manually)
  • Any string that will be part of a URL

Full URI (encodeURI)

Preserves: ; / ? : @ & = + $ , # and alphanumerics

Use for:

  • Complete URLs with structure intact
  • URLs with query strings already formed
  • When you want to preserve URL structure
  • Encoding URLs from user input

Common Use Cases

API Development

Encode query parameters when building API requests to ensure special characters don't break the URL.

Form Handling

Encode form data for GET requests where data is passed in the URL query string.

Deep Links

Create shareable links with complex parameters that include spaces or special characters.

File Downloads

Encode filenames with spaces or special characters in download URLs.

Debugging

Decode encoded URLs from logs or browser dev tools to see the actual values.

Internationalization

Encode non-ASCII characters like Chinese, Arabic, or emoji in URLs.

Frequently Asked Questions

Why do URLs need encoding?

URLs can only contain certain ASCII characters. Special characters, spaces, and non-ASCII characters must be encoded to be safely transmitted and correctly parsed by servers and browsers.

What is the difference between + and %20 for spaces?

Both represent spaces. %20 is the standard URL encoding. + is used in application/x-www-form-urlencoded format (HTML forms). For safety, use %20 which works everywhere.

Why does encoding fail?

Decoding fails when the input is not valid encoded text - for example, if it contains a % not followed by two hex digits. Encoding rarely fails but may have issues with malformed Unicode.

Should I encode entire URLs or just parameters?

Encode only the values that contain special characters. Don't double-encode already encoded URLs. Use URI Component for values, Full URI for complete URLs.

Why do some characters not get encoded?

Alphanumeric characters and some special characters (like - _ . ~) are "safe" and don't need encoding. The exact set depends on whether you use Component or Full URI encoding.

Is URL encoding the same as Base64?

No. URL encoding (percent encoding) converts special characters to %XX format for URLs. Base64 encodes any data into a 64-character alphabet. They serve different purposes.