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.

Try:
0Words
0Characters
0No spaces
0Sentences
0Paragraphs
0Lines
0Pages
0Reading
0Speaking

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

  1. Paste your text or your encoded URL into the box.
  2. Press Encode to make it URL-safe, or Decode to read it.
  3. 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

TextURL-encoded
hello worldhello%20world
a/b?c=da%2Fb%3Fc%3Dd
café&barcaf%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

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

ROT13One button encodes and decodes — ROT13 is its own reverse.Reverse textFlip text backwards character by character, or reverse the order of lines.Title case converterCapitalises a headline properly — short words stay lowercase, unlike naive…Morse codeTurn text into dots and dashes, or decode Morse back to words. Everything runs…Magic 8 ballAsk a yes or no question. The ball answers.Small capsSmall capital letters that paste anywhere plain text goes.Upside down textFlip a line so it reads the other way up. Copy and paste anywhere.

See all text tools →

Frequently asked questions

What is the difference between %20 and +?

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.

Why does encoding escape the slashes and question marks?

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.

Does it handle accents and emoji?

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.

My decoded text shows strange characters — why?

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.

Should I encode the whole URL?

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.

Is URL encoding the same as Base64?

No. Percent-encoding keeps text readable and only escapes unsafe characters; Base64 rewrites everything into a 64-character alphabet. They solve different problems.

Is there a length limit?

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.