URI percent-encoding (encodeURI & encodeURIComponent)
ClientJavaScript exposes two families: encodeURI / decodeURI for strings that already look like URIs, and encodeURIComponent / decodeURIComponent for a single component. Use the workspace below to see the difference on the same paste.
Part of encoding tools.
Workspace
Each button replaces the field with the result so you can copy it. Errors surface when percent-sequences are invalid for the chosen decoder.
encodeURI / decodeURI
?
For strings that already look like URIs: encodeURI escapes characters that are illegal in URIs but keeps separators like /, ?, and #. Pair with decodeURI.
Use this when you need a mostly intact URL string with only illegal characters escaped—not for isolated query values.
encodeURIComponent / decodeURIComponent
?
encodeURIComponent escapes almost everything, including / and ?. Use it for a single path segment, form field, or query value before concatenating into a URL.
The Base64 & URL page also exposes these two—this page adds encodeURI / decodeURI for full strings.
Common use cases
- Escape illegal characters in a mostly complete URL while keeping slashes and query structure (encodeURI).
- Escape a path segment, form field, or query value before concatenating it into a URL (encodeURIComponent).
- Round-trip test strings that mix spaces, Unicode, and reserved characters.
Common mistakes to avoid
Using encodeURIComponent on an entire URL
It will escape ? and /, which breaks the URL shape—use encodeURI for full strings, or encode only the pieces that need it.
Mixing up decodeURI with decodeURIComponent
Pair decodeURI with encodeURI and decodeURIComponent with encodeURIComponent—otherwise you can double-decode or leave stray % sequences.
FAQ
When should I use the Base64 & URL page instead?
That page focuses on UTF-8 Base64 plus URL component encoding in one flow. This page adds encodeURI / decodeURI for full URI strings.
Does anything leave my browser?
No. All transforms run locally in your tab.
Common search terms
Phrases people search for that match this tool. See the full long-tail keyword index.
- encodeuri vs encodeuricomponent
- percent encode full url online
- decodeuri decodeuricomponent online
- javascript uri encoding difference
More tools
Related utilities you can open in another tab—mostly client-side.
Encoding tools
ClientHub index: Base64 & URL, Base32, Base58, quoted-printable, URI, Punycode/IDN, Unicode escapes, data URLs, MIME, hex, HTML entities, JWT, JSON helpers, crypto.
Base64 & URL encoder
ClientUTF-8 Base64 encode/decode and URL component encode/decode in one workspace—paste, transform, copy.
Punycode & IDN converter
ClientUnicode hostnames ↔ Punycode (xn--) labels; paste a hostname or https URL—DNS wire format, client-side.
MIME types & file extensions
ClientLook up common MIME types from extensions (and vice versa)—filterable table, copy Content-Type—client-side.