URL encode and decode
Percent-encode text for safe URLs, or decode %20-style URLs back to text.
This tool percent-encodes text so it is safe to drop into a URL or query string, and decodes percent-encoded URLs back into readable text. Paste your value and press Encode, or paste something full of %20 and %2F and press Decode. It all runs locally in your browser.
Runs entirely in your browser. Your text is never uploaded — open DevTools, Network tab, and you will see zero requests while you use this tool.
How to use it
- Paste your text or your encoded URL into the box.
- Press Encode to make it URL-safe, or Decode to read it.
- Press Copy or Download .txt to keep the result.
What this tool does
URLs are only allowed to contain a limited set of characters. A space, a slash inside a value, a question mark, an ampersand, an accented letter or an emoji all have to be rewritten before they can travel safely in a web address. Percent-encoding does that: each unsafe byte becomes a % followed by its two-digit hexadecimal value, so a space becomes %20 and a slash becomes %2F.
Encoding here uses the same rules as JavaScript's encodeURIComponent, which is what you want for a single value — a search term, a parameter, a redirect target. It escapes &, =, ?, / and # as well, so a value containing them cannot break out and be misread as part of the URL's structure.
Decoding reverses it: every %XX is turned back into the character it stood for, including full UTF-8 sequences, so caf%C3%A9 comes back as café.
Examples
| Text | URL-encoded |
|---|---|
| hello world | hello%20world |
| a/b?c=d | a%2Fb%3Fc%3Dd |
| café&bar | caf%C3%A9%26bar |
The middle row is the important one: the slash, question mark and equals sign are all escaped, so the whole thing stays a single value instead of being read as a path with a query attached.
When you need it
- Building a query string by hand:
?q=plus an encoded search term. - Passing a full URL as a parameter — a redirect, a callback or a share link — where its own
?and&would otherwise collide. - Reading a long, encoded link from an email or a log and wanting to see what it actually points to.
- Fixing a value that arrived with literal
%20or+where a space should be. - Encoding names with spaces, accents or non-Latin scripts for an API call.
Encoding a value vs a whole URL
There are two levels of URL encoding, and mixing them up is the usual cause of broken links. encodeURIComponent — what this tool uses — escapes almost everything, which is correct for a single value you are putting inside a URL. If you ran it on a whole address, it would also escape the :// and the slashes in the path, turning the URL into one big encoded blob.
So: encode the parts (each parameter value), then assemble them into the URL — do not encode the finished URL. When you are decoding, it does not matter; decoding a fully or partly encoded string just returns the readable text.
Doing it without this tool
Browser console: encodeURIComponent('a/b?c=d') and decodeURIComponent('a%2Fb%3Fc%3Dd').
Command line: with Python, python3 -c "import urllib.parse,sys;print(urllib.parse.quote(sys.argv[1]))" 'hello world', and unquote to reverse it.
Excel / Sheets: =ENCODEURL(A1) percent-encodes the contents of a cell.
curl: curl --data-urlencode "q=hello world" … encodes a form value for you.
Privacy: your text never leaves your browser
Encoding and decoding happen in JavaScript on your machine. Nothing you paste is sent anywhere, nothing is stored, and the page works offline once loaded.
That is useful when the URL you are decoding contains a token, a session id or a private redirect target — you can read it without handing it to a third-party site.
Related tools
Frequently asked questions
Both can mean a space. %20 is standard percent-encoding and works everywhere; + means a space only in the query string of a form submission. This tool produces %20, which is the safe choice.
Because it encodes a single value, not a whole URL. Escaping /, ? and & stops the value from being misread as part of the URL structure. Encode each part, then build the URL.
Yes. Characters are converted to UTF-8 and each byte is percent-encoded, so a full encode-then-decode round trip returns exactly what you started with.
The string was probably double-encoded, or encoded with a different byte set. Decode once, and if you still see %XX sequences, decode the result again.
No. Encode the individual values you put into the URL, then assemble it. Encoding the finished URL escapes the :// and slashes and breaks the link.
No. Percent-encoding keeps text readable and only escapes unsafe characters; Base64 rewrites everything into a 64-character alphabet. They solve different problems.
Not in this tool — it runs locally. Note that browsers and servers do limit the length of an actual URL, typically to a few thousand characters.