TL
Tool Lab
πŸ’°Donate
πŸ’°Donate

URI Component Encoder

Percent-encode or decode URI components and full URLs online.

Function:
Plain Input

About This Tool

The URI Component Encoder / Decoder wraps the browser's native encodeURIComponent,decodeURIComponent, encodeURI, and decodeURI functions in a convenient UI. Percent-encoding replaces characters that are not allowed in URLs with a% followed by two hexadecimal digits representing the UTF-8 byte.

encodeURIComponent / decodeURIComponent treats the input as a single component (query parameter value, path segment), encoding all special characters including :/?#[]@!$'&()*+,;=.encodeURI / decodeURI treats the input as a full URL, preserving structural characters like ://?=#& so the URL shape is maintained.

How to Use

  1. Choose Encode to percent-encode or Decode to decode.
  2. Select the function: encodeURIComponent for a single value, or encodeURI for a full URL.
  3. Paste your input or click Sample to load an example.
  4. Click Convert, then Copy the result.

Use Cases

Front-end developers encode query string values before appending them to URLs to prevent injection of additional parameters. Back-end engineers decode percent-encoded form payloads for inspection and debugging. QA engineers verify that a URL copy-pasted from a browser address bar is properly decoded before filing a bug. API integrators encode authentication tokens or special characters in request URLs to ensure safe transmission.

FAQ

  • What is the difference between encodeURI and encodeURIComponent? β€” encodeURI is for full URLs and does not encode characters that are valid at the URL level (:/?#&). encodeURIComponent is for individual components (like a query value) and encodes those structural characters too.
  • Why does a space become %20 and not +? β€” Percent-encoding (%20) is the standard defined by RFC 3986. The + notation is specific to HTML form encoding (application/x-www-form-urlencoded) and not used by these functions.
  • Is my data sent anywhere? β€” No. Everything runs in the browser using JavaScript built-ins. Nothing is transmitted to a server.
  • Why does decoding fail? β€” The input may contain a malformed percent sequence (e.g., %XY where XY is not valid hex) or a lone %. Fix the input or check that you copied the full string.