URL Encoder / Decoder: Encode Decode URLs Online Free

URL encoding (also called percent-encoding) is essential for transmitting data over the web safely. Every time you submit a form, paste a URL with special characters, or send data via query parameters — URL encoding is working behind the scenes.

Understanding URL Encoding

The HTTP protocol only allows a limited set of characters in URLs: letters, digits, hyphens, underscores, tildes, and periods. All other characters must be encoded using percent-encoding, which converts each byte to a %XX format where XX is the hexadecimal ASCII code of the character.

⚡ Try the URL Encoder/Decoder

Encode or decode any URL instantly with our free URL Encoder/Decoder tool. Handles special characters, spaces, Unicode, and full URLs.

When Do You Need URL Encoding?

  • Query parameters — spaces and special chars in search queries (?q=hello world?q=hello%20world)
  • Path parameters — file names with spaces or non-ASCII characters
  • Form submissionsapplication/x-www-form-urlencoded format
  • API requests — embedding JSON or special characters in query strings
  • Bookmarklets — JavaScript URLs with encoded parameters

Key Characters Reference

CharacterEncodedUse Case
(space)%20Most common encoding in URLs
#%23Fragment identifier — do NOT encode in path
&%26Query param separator — encode in values
=%3DKey-value assignment — encode in values
/%2FPath separator — encode in path segments
?%3FQuery string start — encode in path
+%2BReserved — often used for space in query values
(Unicode)%E4%B8%96Multi-byte UTF-8 encoded as multiple %XX pairs

URL Encoding in Different Languages

JavaScript

// Encode
encodeURIComponent("hello world");  // "hello%20world"
encodeURI("https://example.com/a b");  // "https://example.com/a%20b"

// Decode
decodeURIComponent("hello%20world");  // "hello world"

Python

from urllib.parse import quote, urlencode, unquote

# Encode
quote("hello world")          # "hello%20world"
quote("hello world", safe="")  # force encode spaces

# Query dict
urlencode({{"name": "Alice", "city": "New York"}})
# "name=Alice&city=New%20York"

# Decode
unquote("hello%20world")      # "hello world"

URL Safe Encoding

// encodeURI does NOT encode: A-Za-z0-9-_.~
// Use encodeURIComponent for individual values (aggressive)
// Use encodeURI for full URLs (preserves structural chars)

Common Mistakes to Avoid

  • Don't double-encode — encode before sending, decode on receipt. Encoding twice produces %2520 instead of %20
  • Don't encode full URLs with encodeURIComponent
  • — use encodeURI instead, which preserves :/?#[]@!$&'()*+,;=
  • Encode path segments separately — each path segment should be encoded independently
  • Handle Unicode properly — always UTF-8 encode before percent-encoding

⚡ URL Encoder / Decoder

Encode and decode URLs with full Unicode support. Use the free tool →