TheTools.World tool
URL encoder / decoder online
Encode text into percent-encoded (URL-safe) form, or decode percent-encoded text back into readable text. Useful for building query strings, debugging URLs, and reading encoded links.
Encode or decode a URL
Encode text into percent-encoded (URL-safe) form, or decode percent-encoded text back into readable text. Useful for building query strings, debugging URLs, and reading encoded links.
How to encode or decode a URL
- Paste the text or URL you want to encode, or the percent-encoded text you want to decode.
- Choose Encode or Decode.
- Choose component mode if you're encoding a single query parameter value (recommended for most uses), or turn it off to encode a full URL while leaving : / ? & = characters intact.
- Click Run.
- Copy the result into your URL, code, or query string.
Component encoding (encodeURIComponent) escapes characters like & = ? / : that have special meaning in a URL, which is what you want for a single value being placed inside a query string. Full-URL encoding (encodeURI) leaves those characters alone since they're structurally meaningful in a complete URL.
What URL encoding is and how the two modes differ
URL (percent) encoding replaces characters that aren't safe in a URL — spaces, ampersands, non-ASCII letters, and others — with a percent sign followed by their hex code, like a space becoming "%20". Component mode encodes aggressively, escaping characters like & = ? / : # ; that have structural meaning in a URL, which is correct when you're encoding one value to insert into a query string. Full-URL mode encodes less aggressively, leaving those structural characters alone because a full URL needs them intact to remain a valid, working URL.
Best practices
- Use component mode when encoding a single value that will go into a query string, like a search term or a redirect URL passed as a parameter.
- Use full-URL mode only when you have an entire URL and want to escape unsafe characters (like spaces) while leaving the URL's own structure (scheme, slashes, query separators) intact.
- Decode before reading a URL someone sent you if it's full of %XX sequences, to see the actual intended text.
Common mistakes to avoid
- Encoding an entire URL in component mode, which will also escape the
://and?/&characters that make it a working URL, breaking it. - Double-encoding text that's already encoded, which turns a literal
%20into%2520; check whether your input is already encoded before running it through again. - Trying to decode text that isn't validly percent-encoded, which will fail with an error — check for stray
%characters not followed by two hex digits.
Real-world use cases
- Building a query string parameter that contains spaces, symbols, or non-English text.
- Debugging a URL from a browser address bar, API response, or webhook that shows percent-encoded characters.
- Preparing a redirect URL to be passed as a parameter value in another URL.
- Reading encoded tracking or campaign links shared in marketing or analytics tools.
Limitations
This tool encodes and decodes standard percent-encoding as implemented by your browser's built-in encodeURIComponent/decodeURIComponent and encodeURI/decodeURI functions. It does not validate that a URL is otherwise well-formed, and decoding will fail with an error if the input contains invalid percent-encoding sequences (like a stray % not followed by two hex digits).
Privacy
Text you encode or decode is processed locally in your browser. It is not sent to a server, logged, or stored. See the privacy policy for the site's full data handling approach.
Troubleshooting
- If decoding fails with an error, check for a stray
%character not followed by two valid hex digits. - If encoding a full URL breaks it, switch off component mode so structural characters like
://and?are left intact. - If the result looks double-encoded (like
%2520), your input was likely already encoded before you ran it through this tool.
Conclusion
Use component mode to encode a single value for a query string, and full-URL mode when you have a complete URL and only want unsafe characters escaped. For encoding text into Base64 instead of percent-encoding, see Base64 encoder / decoder.
Related tools
FAQ
What's the difference between component and full-URL encoding?
Component encoding escapes structural URL characters like & = ? / so a single value is safe to insert into a query string. Full-URL encoding leaves those characters intact since a complete URL needs them to remain valid.
Why did decoding fail with an error?
Decoding fails if the input contains invalid percent-encoding, such as a % character not followed by two valid hexadecimal digits.
What does %20 mean?
%20 is the percent-encoded form of a space character. Some encoders use + instead of %20 for spaces in query strings specifically; this tool uses the standard %20 form.
Is my text uploaded anywhere?
No. Encoding and decoding happen locally in your browser using built-in browser functions, and your text is not sent to a server.