What this tool does
URL encoding (also called percent-encoding) is the process of replacing characters that have special meaning in a URL, spaces, ampersands, slashes, non-ASCII letters, with %XX sequences a server can parse unambiguously. This tool runs both directions: paste plain text and get the encoded form, paste an encoded URL and get the original back. Everything happens in your browser; no characters travel to a server.
The three modes line up with the three real-world cases you actually hit: encode a full URL (preserve structure), encode a query value (escape everything), or decode whatever percent-encoded mess you were handed.
How to use it
1. Pick a mode in the segmented control: Encode, Encode component, or Decode. 2. Type or paste into the input pane. Output updates after a short debounce, there's no "Run" button to chase. 3. Swap flips the mode and pushes the output back into the input. Useful for round-tripping (encode → tweak → decode) to confirm symmetry. 4. Copy or Download the result. The download is a plain .txt file named encoded.txt or decoded.txt.
When you decode something that contains key=value&key2=value2 pairs, the tool also renders a small Parsed params table below, handy for inspecting query strings without manually splitting on &.
Encode vs Encode component, the only distinction that matters
JavaScript ships with two encoders, and picking the wrong one is the most common URL-encoding mistake.
encodeURIpreserves URL structure. It leaves the reserved characters: / ? # [ ] @ ! $ & ' ( ) * + , ; =alone because those have meaning in a full URL. Use this when you have an entire URL string and just need to escape the unsafe parts (spaces, Unicode,<,>).encodeURIComponentescapes everything. It encodes the reserved set, because at the component level (a single query value, a path segment, a fragment) those characters are data, not structure. Use this when you're building a query value or path segment from user input.
The classic bug: building ?q= + a search term with encodeURI. Hit a & inside the search term and the server now sees two query params instead of one. Always use encodeURIComponent for query values.
What the decoder does
Decode runs decodeURIComponent on your input, after first replacing + with a space (the application/x-www-form-urlencoded convention used by HTML forms). Most decoders forget the + substitution and you end up with John+Doe instead of John Doe. This one handles it.
If the decoded text looks like a URL (or like a query string), the tool tries to extract ?key=value&… pairs and displays them in the params table. The parser is the browser's native URL + URLSearchParams, so it follows the same rules a real server would.
Common gotchas
- Double-encoding. Decoding text that was already plain leaves it unchanged. Decoding text that was encoded twice leaves it half-encoded. If your output still has
%25sitting around, you encoded it twice somewhere upstream. - Plus vs space. In
application/x-www-form-urlencoded(HTML form bodies and most query strings),+decodes to a space. In path segments,+is a literal plus. Be aware which context your data came from. - Unicode. Both encoders emit UTF-8 bytes by default, a single emoji becomes 4 escape sequences (e.g.
%F0%9F%98%80). If your decoded output looks like garbage, the source was probably not UTF-8. - Already-encoded input to the encoder. Running
encodeURIComponentover%20produces%2520, the%itself gets encoded. Decode first, then re-encode.
Privacy
Your input, the encoded/decoded output, and any parsed query parameters stay in your browser. Nothing is sent to a server. Recent inputs are stored only in your browser's local storage and can be cleared from the "Recent" card.