URL Encode / Decode
Encode text into percent-encoded URL format or decode it back, instantly and offline in your browser.
Example
Encoding hello world & more? with encodeURIComponent gives hello%20world%20%26%20more%3F (length 28). Switch to Decode mode and paste that back to recover the original text.
How it works
Encoding uses JavaScript's encodeURIComponent(), which escapes characters unsafe in URLs (spaces, &, ?, /, etc.) as percent-encoded UTF-8 bytes like %20. Decoding uses decodeURIComponent() to reverse the process.
Good to know
This URL Encode / Decode tool converts plain text into percent-encoded form (where unsafe characters become sequences like %20 for a space or %26 for an ampersand) and reverses that conversion back to readable text. It runs entirely in your browser using JavaScript's encodeURIComponent and decodeURIComponent, so it is built for developers, QA testers, marketers building tracking links, and anyone who needs to drop a value safely into a query string or path segment.
Reach for encoding whenever a piece of text needs to live inside a URL but contains characters that have special meaning there, such as spaces, &, ?, =, /, #, or non-ASCII letters. Common cases include putting a search phrase into a ?q= parameter, passing an email or a full URL as a redirect value, or wiring up UTM campaign tags. Use decoding to make a captured link human-readable again or to confirm what an encoded parameter actually contains before debugging it.
The two length counters help you sanity-check the result rather than measure anything precise. Each escaped character expands into a percent sign plus two hex digits, so the output length growing well beyond the input is normal and simply signals how many reserved or multi-byte characters were present. If decode mode shows an "Invalid input" message, the string has a broken percent sequence (a lone % or one not followed by two valid hex digits) and was likely never properly encoded.
One caveat to keep in mind:
- This tool encodes a single component, not a whole address, so it deliberately escapes &, ?, =, and / — running a complete URL through encode mode will mangle the slashes and separators you want to keep, so encode only the individual value you are inserting.
Frequently asked questions
What's the difference between encodeURIComponent and encodeURI?
This tool uses encodeURIComponent, which escapes reserved characters like &, ?, /, and = so a value is safe inside a single query parameter or path segment. encodeURI leaves those characters intact because it's meant for encoding a whole URL, not a component of one.
Why does decoding sometimes show an error?
decodeURIComponent throws if the string contains a malformed percent sequence, such as a stray % not followed by two valid hex digits (e.g. %ZZ or a lone %). Make sure you're decoding text that was actually percent-encoded.
Is my data uploaded anywhere?
No — this calculator runs entirely in your browser. Your inputs never leave your device, and it works offline once loaded.
Is this calculator free?
Yes, completely free with no sign-up and no limits.
People also ask
What does %20 mean in a URL?
%20 is the percent-encoded representation of a space character. URLs cannot contain literal spaces, so a space is replaced with %20 (or sometimes a + sign in form-encoded query strings).
How do I encode a space in a URL?
In path segments and most query values a space becomes %20, which is what encodeURIComponent produces. In application/x-www-form-urlencoded form data, a space may instead be written as a + sign.
Is URL encoding the same as Base64 encoding?
No. URL (percent) encoding only escapes characters that are unsafe in a URL while leaving most text readable, whereas Base64 transforms all data into a compact set of 64 ASCII characters, usually to carry binary data as text. They serve different purposes and are not interchangeable.
Can I encode an entire URL with this tool?
This tool uses encodeURIComponent, which escapes structural characters like :, /, ?, and &, so encoding a full URL would break it. Use it on individual values you place inside a URL, not on the complete address.
Why does my encoded text look longer than the original?
Each escaped character expands into a percent sign plus two hexadecimal digits, and non-ASCII characters can use several bytes, so the encoded output is normally longer than the input. The growth reflects how many reserved or multi-byte characters were present.
What characters need to be URL encoded?
Characters that have reserved meaning or are unsafe in URLs, including spaces, &, ?, =, #, /, %, +, and non-ASCII letters such as accented or non-Latin characters. Unreserved characters (letters A-Z, digits, and - _ . ~) are left unchanged.
Does URL encoding handle emoji and non-English characters?
Yes. encodeURIComponent first converts the character to its UTF-8 bytes and then percent-encodes each byte, so emoji and non-Latin scripts produce several percent sequences that decode back to the original character.
Is it safe to double-encode a URL?
Double-encoding (encoding text that is already encoded) turns each % into %25 and can cause values to be misread when decoded only once. It is generally avoided unless a value must survive being decoded by two separate systems.
Related calculators