URL Encoder/Decoder

Turn text into safe URL encoding, or decode percent-encoded text back to normal. Bad input shows a clear error instead of crashing.

Last updated: 17 November 2026.

Encoding turns spaces and special characters into safe codes. Decoding turns those codes back into normal text.

What URL encoding is

A web address can only carry a small set of safe characters: letters, numbers, and a few marks like the hyphen and the dot. Everything else has to be rewritten before it can travel in a link. That rewriting is called URL encoding, or percent encoding. A space becomes %20. An ampersand becomes %26. A question mark becomes %3F. Each unsafe character is replaced by a percent sign followed by two letters or numbers that stand for its code. The web address still works, and the browser turns the codes back into the original characters when it reads the link.

How to use this tool

Paste your text or link into the first box and press Encode to turn it into safe URL encoding, or press Decode to turn encoded text back into normal text. The result appears in the second box, ready to copy. The first box comes with a sample link already filled in, so you can press Encode straight away and see the spaces and the ampersand turn into codes, then copy the result, paste it back in, and press Decode to watch it return to normal. That round trip is the quickest way to learn what the tool does.

Which characters get encoded

Spaces are the most common case, and they become %20. Then come the characters that have a job in a link: the question mark, the ampersand, the equals sign, the plus sign, the hash, and the slash. Letters and numbers are never encoded, and neither are the hyphen, the underscore, the dot, and the tilde. This tool encodes everything except those safe characters, which matches the standard used by browsers. Non English letters, like accented letters or Urdu script, are encoded too, because they are turned into their UTF-8 bytes first, and each byte becomes a percent code.

Encoding a full link versus one value

There are two ways to encode, and mixing them up causes most mistakes. Encoding one value means encoding only the text that goes after the equals sign, like a search term, while the rest of the link stays normal. Encoding a full link means encoding the whole address, including the colons and slashes, which is what you do when one link has to sit inside another link, for example a redirect address tucked into a tracking link. This tool encodes everything you paste, so it behaves like the full link case. If you only want one value encoded, paste just that value, not the whole address.

Where you will meet encoded URLs

Search links are the most common place. When you search for something with spaces, the address bar shows %20 where each space was. Sharing a link with a long title does the same thing, and pasting that link into a chat shows the coded form until the chat app shortens it for display. Email links, social media links, and tracking links all carry encoded values too, because they pack extra detail into the address: a campaign name, a product ID, or a referral code. Developers meet encoding every day as well, since any value sent to an API has to be encoded or the server reads it wrong. If you also handle data in other formats, the base64 encoder and decoder covers the other common way of making text safe to send.

Decoding, and what can go wrong

Decoding is the reverse step. It reads each percent code and puts the original character back. Most of the time it just works. It fails when the text is not really encoded, and the usual cause is a lone percent sign. A sentence that says 50% off contains a percent sign followed by a space, which is not a valid code, so decoding it throws an error. The same happens with a typo like %zz, where the two characters after the percent sign are not valid hex digits. This tool catches that case and shows a clear error in plain words, instead of crashing or giving a wrong answer. If decoding fails, look for the bad percent sign first: remove it, or write it as %25, and decode again.

Encoding, privacy, and other formats

URL encoding is not encryption, and it is not security. Anyone can decode a link in a second, so it never hides anything. Passwords, tokens, and private detail should never sit in a web address, encoded or not, because addresses are saved in browser history, server logs, and shared links. Encoding only makes text safe to travel, nothing more. For text that needs to be stored or checked in a structured way, a format tool is the better choice, and the JSON formatter cleans up JSON data, checks it for errors, and points to the exact line of a problem. This tool runs fully in your browser with plain JavaScript, so the text you paste never leaves your device, nothing is uploaded, and nothing is stored.

Frequently asked questions

What does URL encoding do?

It replaces unsafe characters in a link with percent codes. A space becomes %20, an ampersand becomes %26, and a question mark becomes %3F, so the link travels safely and the browser can read it back.

How do I decode a URL?

Paste the encoded text into the box and press Decode. Percent codes turn back into normal characters. If the text has a bad code like %zz, the tool shows a clear error instead of crashing.

Why do spaces become %20?

A web address cannot carry a raw space. The space is turned into its code, %20, which is the percent sign followed by the hex code for a space. Browsers and servers understand that code and turn it back into a space.

What is double encoding?

It happens when encoded text is encoded a second time. The percent sign itself becomes %25, so %20 turns into %2520. Decode once and check the result reads normally before you encode again.

Is my text sent anywhere?

No. Encoding and decoding run in your browser with plain JavaScript. The text you paste never leaves your device, and nothing is stored.