URL Encode & Decode
Percent-encode query values and whole URLs, or decode them back — in one click, right in your browser and nothing uploaded.
Component — escapes every reserved character. Use for a single query value or path segment.
Quick answer
URL encoding (percent-encoding) replaces unsafe characters with a % followed by two hex digits so they can travel safely inside a link. Choose Encode or Decode, then pick the method: component (encodeURIComponent) for a single query value, or whole URI (encodeURI) for a complete URL. Paste your text to see the result instantly. Everything runs privately in your browser.
Why URLs need encoding
URLs may only contain a limited set of characters, and several of those — ? # & = /— carry special meaning as separators. If you drop a raw search phrase or a value containing those characters straight into a link, the browser or server misreads where one part ends and the next begins. Percent-encoding replaces each unsafe byte with %XX, so a space becomes %20 and an ampersand becomes %26, keeping the link unambiguous and unbroken.
Component vs whole URI
The right method depends on what you are encoding. encodeURIComponentescapes nearly everything, including the reserved separators, which is exactly what you want for a single piece — one query value, one path segment, a redirect target. encodeURI is gentler: it leaves the structural characters : / ? # & = alone so an entire, already-formed URL stays usable. As a rule, encode individual values with the component method and assemble the final URL around them.
Decoding safely
Decoding reverses percent-encoding back to readable text, which is handy for inspecting a query string or a logged URL. It only fails when the input is malformed — a lone % or a %not followed by two hex digits — and this tool reports that clearly instead of returning garbled output. Use the same method you encoded with: component for values, whole URI for full links.
Private by design
URLs can hold tokens, IDs and personal parameters, so privacy matters. Every conversion here happens on your own device with client-side JavaScript. Nothing is uploaded, stored or logged, and the tool keeps working even offline.
Frequently asked questions
Is my input uploaded to a server?+
No. Encoding and decoding run entirely in your browser with JavaScript. Nothing you type or paste is uploaded, logged or seen by anyone — it never leaves your device, so it is safe for private URLs and data.
What is the difference between encodeURIComponent and encodeURI?+
encodeURIComponent escapes almost everything, including reserved characters like : / ? # & and =, so it is right for a single query value or path segment. encodeURI leaves those reserved characters intact because it is meant for encoding a whole, already-structured URL.
When should I URL-encode text?+
Whenever you put user text or arbitrary data into a URL — a search term, a filter value, a redirect target — encode it so spaces, ampersands, plus signs and non-ASCII characters don't break the link or get misread as separators. Use component encoding for individual values.
Why does decoding sometimes show an error?+
Decoding fails on malformed percent-sequences — a lone % sign, or % not followed by two hexadecimal digits. When that happens the tool reports the problem instead of returning a broken or misleading result.
How are spaces handled?+
encodeURIComponent and encodeURI turn a space into %20. Note that the older application/x-www-form-urlencoded style used in form submissions encodes a space as a plus sign instead — this tool follows the modern %20 behaviour used in URLs.