URI Component Encoder
Percent-encode or decode URI components and full URLs online.
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
- Choose Encode to percent-encode or Decode to decode.
- Select the function:
encodeURIComponentfor a single value, orencodeURIfor a full URL. - Paste your input or click Sample to load an example.
- 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? β
encodeURIis for full URLs and does not encode characters that are valid at the URL level (:/?#&).encodeURIComponentis 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.,
%XYwhere XY is not valid hex) or a lone%. Fix the input or check that you copied the full string.