โ† All Tools

URL Encoder & Decoder

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

Ad Space โ€” Google AdSense

What is URL Encoding?

URL encoding (also called percent-encoding) converts characters that aren't allowed in URLs into a safe format using percent signs followed by hexadecimal values. URLs can only contain a limited set of ASCII characters โ€” letters, digits, and a few special characters. Everything else (spaces, Unicode characters, reserved delimiters) must be encoded to be safely transmitted in URLs, query strings, and form data. For example, a space becomes %20, an ampersand becomes %26, and emoji characters become multi-byte percent-encoded sequences.

How to Use This Tool

  1. Choose the encoding mode: "Encode Component" for query parameter values (encodes everything including &, =, /), or "Encode URI" for full URLs (preserves URL structure characters).
  2. Paste your text or URL in the input field and click the appropriate encode/decode button.
  3. Copy the result and use it in your URL construction, API calls, or form submissions.

Common Use Cases for Developers

  • Query parameter encoding: Encode user input before appending to URLs: ?search=hello%20world&tag=c%2B%2B.
  • API integration: Properly encode path segments and query values when constructing REST API URLs programmatically.
  • Redirect URLs: Encode callback/redirect URLs passed as query parameters (URL-within-a-URL) to prevent parsing ambiguity.
  • Form data debugging: Decode application/x-www-form-urlencoded POST bodies to inspect submitted form values.
  • Deep link construction: Encode parameters in mobile deep links and universal links that contain special characters.

Tips & FAQ

  • encodeURIComponent vs encodeURI: Use encodeURIComponent for individual parameter values โ€” it encodes &, =, /, ?, and #. Use encodeURI for complete URLs โ€” it preserves the URL structure (protocol, host, path separators).
  • Common mistake โ€” double encoding: If your URL already contains %20 and you encode again, it becomes %2520. Always encode raw values, not already-encoded strings.
  • Space encoding: Spaces can be encoded as %20 (standard) or + (form encoding). encodeURIComponent uses %20; HTML form submissions use +. Be consistent within your application.