URL Encode/Decode

URL encode or decode text online: percent-encode spaces, &, accents and emoji with encodeURIComponent or encodeURI, or decode %XX strings back to text.

Runs in your browser. Files never leave your device.
Mode:

About the URL Encode/Decode

URL encode text to turn spaces, ampersands, accented letters and emoji into percent encoding that is safe inside a link, or decode a %-filled string back into readable text. It comes up when you build a query string for an API call, and when a UTM-tagged link or a redirect address is too full of % signs to read.

Encoding has two modes: Strict for a single value and Full URL for a whole address. The Swap button turns the result straight back into input, so you can check a round trip. The work is done in your browser by the standard JavaScript functions, which means pasted URLs and tokens stay on your device.

How it works

Percent encoding replaces a character with a % sign and two hexadecimal digits for each byte of its UTF-8 form. A space becomes %20, & becomes %26, Γ© (two bytes in UTF-8) becomes %C3%A9, and an emoji takes four bytes, such as %F0%9F%98%80 for πŸ˜€. Letters, digits and - _ . ! ~ * ' ( ) are never changed.

encodeURIComponent (Strict) also encodes the characters that give a URL its structure: : / ? # & = + , ; @ $. Use it for one piece of a link, such as a search term, a parameter value or a redirect address passed inside another URL. encodeURI (Full URL) leaves those structural characters alone and encodes only what can't appear in an address at all, such as spaces, quotes and non-English letters, so a complete link keeps working.

Decode mode runs decodeURIComponent, which turns every %XX sequence back into its character, including %2F and %3F. If the input has a % that isn't followed by two hex digits, or bytes that aren't valid UTF-8, a red message under the boxes explains which problem it found, and points to the stray % by position, instead of guessing.

Assumptions and limits

  • Decoding does not turn + into a space. HTML forms send spaces as +, so a string like hello+world decodes to hello+world; replace + with %20 first if it came from a form.
  • A lone % is an error when decoding. Text such as '100%' must be encoded first, which turns it into 100%25.
  • Each pass encodes the % signs from the last one, so encoding twice gives %2520 for a space. Decode the same number of times it was encoded.
  • Encoding uses UTF-8, the standard for URLs today. Older pages that encoded in Latin-1 (Γ© as %E9) cannot be decoded here and show an error.
  • Full URL mode never changes ? & = #, so values that contain those characters must be encoded with Strict mode before they are joined into the link.

Worked examples

Encode a full URL with spaces

The Sample URL button loads an address with a space in the search term. In Full URL mode only the space changes and the link stays usable. In Strict mode every : / ? = & and # is encoded too, which is right only when the whole address is going inside another URL's parameter.

Input:     https://example.com/search?q=hello world&category=tools#top
Full URL:  https://example.com/search?q=hello%20world&category=tools#top
Strict:    https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26category%3Dtools%23top

Percent-encode a query string value

Searching for 'Tom & Jerry' breaks a link if the & is left in, because it starts a new parameter. Strict mode gives a value that can sit safely after q=. The same applies to a + sign, which a server may read as a space.

Tom & Jerry   β†’  Tom%20%26%20Jerry
a+b=c         β†’  a%2Bb%3Dc
C# / .NET     β†’  C%23%20%2F%20.NET

Decode a URL that was encoded twice

Tracking redirects sometimes encode a link twice, leaving %25 everywhere. Paste https%253A%252F%252F in Decode mode and you get https%3A%2F%2F. Press Swap to send that back in as input; Swap also switches to Encode, so press Decode URL again and the readable https:// appears.

Common percent-encoded characters

Read the table either way: encoding the character gives the code, and decoding the code gives the character. A dash in the Full URL column means encodeURI leaves that character as it is.

CharacterStrict (encodeURIComponent)Full URL (encodeURI)
space%20%20
!!!
"%22%22
#%23β€”
$%24β€”
%%25%25
&%26β€”
+%2Bβ€”
,%2Cβ€”
/%2Fβ€”
:%3Aβ€”
;%3Bβ€”
=%3Dβ€”
?%3Fβ€”
@%40β€”
Γ©%C3%A9%C3%A9
€%E2%82%AC%E2%82%AC

How to use the URL Encode/Decode

  1. Choose Encode or Decode. Pick Encode URL or Decode URL at the top. When encoding, choose Strict for a single value or Full URL for a complete web address.
  2. Paste your text. Type or paste into the left box, or press Sample URL to try one. The result appears on the right as you type.
  3. Copy or swap. Press Copy to take the result, or Swap to move it into the input and flip between Encode and Decode, which is how you check a round trip. To peel off a second layer of encoding, press Swap and then Decode URL again.

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent encodes everything except letters, digits and - _ . ! ~ * ' ( ), including / ? & = and #, so it suits one value inside a link. encodeURI keeps those structural characters, so it suits a whole address that only needs spaces and special letters fixed.

Why does a space become %20 and not +?

Because %20 works everywhere in a URL, and + doesn't. The + form comes from HTML form submissions and only means a space inside a query string read as form data. Percent encoding writes a space as %20, so that is what both modes produce.

How do I decode a URL with %2F and %3A in it?

Choose Decode URL and paste it in: %2F turns back into /, %3A into : and every other %XX code into its character. If the result still contains codes like %2F, the link was encoded twice: press Swap, which moves the result into the input and switches to Encode, then press Decode URL again.

Why does decoding say it can't decode my text?

Either the input has a % that isn't followed by two hex digits, as in '50% off', and the message gives that %'s position, or its %XX codes don't form valid UTF-8, which happens with links made by older systems using Latin-1. Change a stray % to %25, then decode again.

Can I encode Arabic, Urdu, Chinese or emoji in a URL?

Yes. Each character is converted to its UTF-8 bytes and every byte is written as %XX. The Japanese word ζ—₯本 becomes %E6%97%A5%E6%9C%AC, and the decoder turns those codes back into the original script.

Is it safe to paste URLs with tokens or private links?

Yes. The encoding and decoding use functions built into your browser and run on your device, so the text you paste isn't sent to VelixaKit or anyone else. Clearing the box removes it from the page.

This tool runs entirely in your browser. What you enter or upload stays on your device and is never sent to our servers.