URL encoding without the guesswork
LOCALA URL can only carry a small set of characters unchanged. A space, a Japanese file name, an ampersand inside a search phrase or a plus sign in a phone number has to become a percent escape before a browser, a server or an analytics tag will treat it as one value. This tool converts in both directions and separates the three cases people constantly mix up: a single component such as a query value, a complete URL whose separators must survive, and form data where a space turns into a plus. It also explains failures instead of returning mojibake: a stray %ZZ or a truncated UTF-8 sequence is reported with the approximate position where it stops making sense. Everything runs locally in this tab.
How it works
- 01
Pick encode or decode
Both tabs share one text box, so you can encode a value, copy the result, switch tabs and paste it back to check that the round trip is clean. Switching tabs does not clear the input. Encoding is the usual starting point when you have readable text that must travel inside a link. Decoding is what you need when a URL, a log line or a spreadsheet cell arrives full of %20 and %E4 sequences and you want to read it again.
- 02
Choose the right scope
Component is encodeURIComponent: it escapes every separator, including &, =, ?, / and #, so the result is safe as the value of one parameter. Full URL is encodeURI: it keeps the punctuation that gives an address its structure, so https://example.com/a b?q=1#top becomes https://example.com/a%20b?q=1#top instead of one opaque blob. Form data follows application/x-www-form-urlencoded, where a space becomes a plus sign and a literal plus has to be written as %2B. Picking the wrong scope is the most common cause of broken links.
- 03
Read the result while you type
The output updates on every keystroke; there is no submit step. If decoding meets a percent sign that is not followed by two hexadecimal digits, such as %ZZ or a trailing %, it stops and reports the approximate character position instead of printing replacement characters. The same applies to byte sequences that are not valid UTF-8, for example %E0%A4, which begins a three-byte sequence that never finishes. Encoding a string with an unpaired surrogate, often caused by copying half an emoji from a chat app, is also refused with a short explanation.
- 04
Copy, or decode repeatedly
The copy button writes the current output to the clipboard and confirms with a short “Copied”. In decode mode, the “Decode repeatedly” checkbox repeats the operation until the text stops changing, with a ceiling of five passes. That is how %2520, a doubly encoded space, becomes a real space: the first pass produces %20 and the second produces the space. If a later pass would fail, the tool keeps the last readable result rather than throwing away work that is already usable.
When to use it
UTM tags and campaign links
Marketing links often carry several values: a source, a medium, a campaign name with spaces, and a destination URL nested inside utm_content. Encode each value in component mode before joining them with & and =. If you encode the finished link instead, the & and = that separate parameters turn into %26 and %3D and the analytics platform sees one long parameter. Full-URL mode is for the case where a complete address already exists and only its illegal characters need to be made legal.
Debugging redirect chains
A redirect URL is frequently passed as a parameter, which means an inner URL is encoded and then placed inside an outer one. After two hops you can see strings such as https%3A%2F%2Fexample.com%2Fpath%3Fq%3D%2520, where the double encoding is easy to miss. Paste the value here, enable repeated decoding, and the layers collapse until the address is readable. If the last pass stops with an error, the string itself is broken rather than merely encoded, which is a different problem to report to whoever generated the link.
Search phrases in any language
Search boxes and share buttons have to carry Japanese, Korean, Arabic or accented Latin text through a protocol that is ASCII-based. encodeURIComponent turns each character into the UTF-8 bytes of the text, written as %E4%B8%AD or %C3%A9. That is why a query with one CJK character is much longer than the original. Decoding reverses it exactly, provided the original page declared UTF-8. Legacy encodings such as Shift_JIS produce byte sequences that are valid percent escapes but decode to the wrong characters, and no tool can guess the declaration that is missing.
Forms, APIs and plus signs
HTML forms send data as application/x-www-form-urlencoded by default, so a space arrives at the server as +. API clients that copy a query string from a browser sometimes forget this and send a literal +, which a form parser reads as a space. If a phone number like +49 30 1234 becomes 49 30 1234 on the other side, the plus was eaten by form decoding. Use form mode when you are matching what a browser form does, and component mode when you are writing an RFC 3986 query string where + is a literal plus.
Questions
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent leaves only A–Z, a–z, 0–9 and - _ . ! ~ * ' ( ) untouched; everything else, including +, &, =, / and #, becomes a percent escape. encodeURI leaves the structural punctuation of a URL in place, namely ; / ? : @ & = + $ , #, so the result can still be parsed as an address. Use encodeURIComponent for a value inside a parameter and encodeURI for a whole link whose separators are already in the right places. Encoding a component with encodeURI is a classic bug: the & inside a search phrase survives and silently creates an extra parameter.
Should a space be %20 or +?
In a path or an RFC 3986 query value, %20 is correct and unambiguous. In application/x-www-form-urlencoded the historical convention is +, and HTML forms still use it. The two are not interchangeable: in data analyzed as form encoding, a literal + means space, so a real plus must be sent as %2B. This tool follows the scope you pick; component and full URL produce %20, while form data produces + and never produces a bare plus for a space.
Why does %E0%A4 fail to decode?
%E0 starts a three-byte UTF-8 sequence, and the decoder expects two continuation bytes in the range 80–BF immediately after it. %A4 is a valid continuation, but a sequence such as %E0%A4 alone is truncated: the third byte is missing. Printing a replacement symbol would hide the problem, so the tool refuses and points at the position. Typical causes are a URL cut in a chat message, a database column that was too short, or a percent sign lost during a copy and paste.
What is double encoding and how do I undo it?
Double encoding happens when an already encoded string is encoded again: a space becomes %20, then the percent sign itself becomes %25, producing %2520. One decode pass yields %20 and a second yields the space. Tick “Decode repeatedly” to run up to five passes until the text stops changing. If a later pass would fail, the tool keeps the last readable output, because a literal % in ordinary text is not a valid escape and should not destroy a usable result.
Does decoding turn + into a space?
Only in form-data mode. Under RFC 3986, + is a literal character and a space must be written %20. Browsers and servers disagree in practice, which is why the scope selector exists. If you are reading a value copied from a form submission or a typical PHP query string, choose form data. If you are reading a path segment or a URL built by encodeURIComponent, choose component, where + stays a plus.
Is %2F the same as a slash?
It decodes to the same character, but it does not mean the same thing on the wire. A proxy or a framework may decode %2F before routing and treat it as a path separator, or may reject it to prevent path traversal. Keeping it encoded is sometimes the only way to pass a slash inside a single path segment. Use component mode when a value must survive as one segment, and check the server's behavior instead of assuming it.
How are emoji and other non-Latin characters encoded?
As the UTF-8 bytes of the code point. An emoji such as 😀 (U+1F600) becomes %F0%9F%98%80, four bytes, while a Chinese character such as 中 becomes %E4%B8%AD, three bytes. That is why an encoded string is longer than the visible text and why truncating it in the middle of a sequence breaks decoding. The tool validates the byte structure, so a half-copied emoji is reported instead of quietly becoming a replacement symbol.
Does it decode the reserved escapes that decodeURI keeps?
In component and form modes, yes: every valid escape is decoded, including %23, %26 and %2F. The built-in decodeURI function is more conservative and leaves escapes for reserved characters alone, which is useful when you must not change the structure of a URL. This tool does not offer that conservative mode; if you need it, decode one component at a time instead of decoding the whole address in a single pass.
Is my text uploaded or logged?
No. Encoding and decoding are string operations in the current tab. There is no network request, no account and no storage; the only thing sent is a single anonymous usage ping after you copy a result. You can watch the browser's Network panel while typing and confirm that nothing else leaves the page. Closing or reloading the tab discards the input.