Home/Tools/Text & developer utilities
URL Encoder and Decoder
Component encoding by default, which is what query strings need.
Why URLs need encoding at all
A URL has structure. Slashes separate path segments, question marks start the query, ampersands separate parameters, and hashes start the fragment. If your data contains one of those characters, it has to be disguised or the URL falls apart.
Percent encoding replaces a character with a percent sign and its hexadecimal byte value. A space becomes %20, an ampersand %26, a slash %2F.
The two kinds, and which you want
This is the choice that trips people up:
- Component encoding escapes everything unsafe, including /, ?, & and =. Use it for a value going inside a query parameter, which is almost always what you want.
- Full URL encoding leaves those structural characters alone, because it assumes you are encoding a whole URL that needs to keep working. Use it only for that.
Getting this wrong is the cause of a specific and common bug: a URL passed as a parameter to another URL. Without component encoding, the inner URL's query string merges into the outer one and everything after the first ampersand goes to the wrong place.
The plus sign problem
In the query string of a form submission, a space is traditionally encoded as + rather than %20. That convention comes from HTML forms and does not apply to the path, where a plus is a literal plus.
So %2B is a genuine plus sign and + might be a space — depending on which part of the URL it appears in. Decoding here treats a plus as a space, which is right for query strings and wrong for paths, so check the context if a result looks odd.
Double encoding
Encode twice and %20 becomes %2520, because the percent sign itself gets encoded. If you are seeing %25 in a URL that should contain spaces, something in the chain has encoded it twice.
Common uses
- Building a query string safely.
- Passing a URL as a parameter — a redirect target, a callback.
- Reading an encoded URL out of a log.
- Debugging a link that breaks at a particular character.
Questions people ask
What is the difference between encodeURI and encodeURIComponent?
Component encoding escapes the structural characters / ? & and = as well. Use it for a value inside a query parameter; use full URL encoding only for a whole URL.
Why is a space sometimes + and sometimes %20?
The plus convention comes from HTML form submissions and applies to query strings. In a path, a plus is a literal plus.
What does %2520 mean?
Double encoding. %20 was encoded again, turning the percent sign into %25. Something in the chain encoded the value twice.
Why does my URL break after an ampersand?
Because a value containing an ampersand was not component-encoded, so it reads as the start of the next parameter.
Your text stays in the page
This matters more here than on most tools. People paste API keys into hash generators, customer data into CSV converters, contract wording into diff checkers and configuration into JSON validators. Almost every site offering these sends your input to a server to process it.
Nothing here is transmitted. The work happens in your browser, this site is static files with no server behind it, and the about page lists every request the site makes, read live from your own browser so you can check rather than trust.