URL Encoder & Decoder

Encode special characters for URLs or decode percent-encoded strings back to readable text.

How it works: Paste text or a URL below. Encode converts special characters to percent-encoded format (%XX) for safe URL usage. Decode reverses the process back to readable text.

encodeURIComponent — encodes everything, use for parameter values

15 characters encoded

What is URL Encoding?

URL encoding (also called percent-encoding) converts characters into a format that can be safely transmitted in URLs. Characters that have special meanings in URLs (like &, =, ?, /, #) or non-ASCII characters (like accented letters and emoji) are replaced with a percent sign followed by their hexadecimal value. For example, a space becomes %20 and an ampersand becomes %26.

When Do You Need URL Encoding?

URL encoding is necessary whenever you include user input in URLs, build query strings with special characters, pass data through URL parameters, or work with APIs that require encoded values. Without proper encoding, URLs can break or be misinterpreted by browsers and servers. It is also essential for preventing injection attacks in web applications.

encodeURIComponent vs encodeURI

JavaScript provides two encoding functions. encodeURIComponent encodes everything except letters, digits, and a few safe characters (- _ . ! ~ * ' ( )). Use it for encoding individual parameter values. encodeURI encodes a full URL but preserves characters that have meaning in URLs like :, /, ?, #, and &. Use it when you want to encode a complete URL without breaking its structure.

Common Use Cases

  • Building API query strings with special characters
  • Encoding form data for GET requests
  • Passing file paths or names in URLs
  • Encoding non-ASCII characters (accents, CJK, emoji)
  • Debugging encoded URLs from logs or analytics
  • Preparing redirect URLs with parameters