Converters

URL Encoder & Decoder

Encode text for safe use in a URL, or decode a URL-encoded string back to plain text. Runs entirely in your browser.

How it works

Encode converts text into percent-escapes using the browser's encodeURIComponent, so it can sit safely inside one part of a URL such as a query-string value: a space becomes %20 and é becomes %C3%A9. Decode reverses it with decodeURIComponent.

Example

Encoding a b&c=1/é gives a%20b%26c%3D1%2F%C3%A9. Because characters such as : / ? & and = are escaped too, encode individual values rather than a whole address — encoding https://example.com/a b would turn the :// into %3A%2F%2F and break the link.

Edge cases

A plus sign is not turned into a space when decoding (a+b stays a+b); only %20 becomes a space. Decoding fails with an error if the text contains a stray % that isn't followed by two hexadecimal digits, such as 100%. Letters, digits and the characters - _ . ! ~ * ' ( ) are never encoded.

A worked example: a search link

To build a search link for the phrase tea & coffee, 50% off, encode the phrase on its own and place it after the equals sign: https://example.com/search?q=tea%20%26%20coffee%2C%2050%25%20off. Left unencoded, the ampersand would end the value early and the percent sign would be read as the start of an escape.

Accents, non-Latin text and emoji

Text is converted to UTF-8 bytes first and each byte becomes a %XX pair, so one character can take several groups. naïve café becomes na%C3%AFve%20caf%C3%A9, and a single emoji such as 😀 becomes %F0%9F%98%80, four bytes. This is why encoded links with non-English text look long.

Spaces, plus signs and double encoding

Spaces are written as %20, never as a plus sign. HTML form submissions use plus for a space, but this decoder leaves a plus alone, so decoding form data containing plus signs means replacing them with spaces yourself. A literal plus is encoded as %2B (a+b becomes a%2Bb). Encoding text that is already encoded turns %20 into %2520, so if you see %25 in a link it has probably been encoded twice and needs decoding twice.

What to encode

Encode each value or path segment separately, then join the pieces. Encoding a whole address would also escape its slashes and colons and break it, and encoding a path segment turns / inside it into %2F. The tool performs only this component-level encoding and never touches text it is not asked to convert.

Frequently asked questions

What's the difference from Base64 encoding?

URL encoding (percent-encoding) replaces unsafe characters with %XX codes so text can appear in a URL; Base64 is a different, general-purpose binary-to-text encoding used for other purposes, like embedding data.

Why do accented letters and emoji turn into several %XX groups?

Each character is converted to UTF-8 bytes, and every byte is written as its own %XX pair. An accented letter takes two bytes and most emoji take four, so one visible character can produce up to four groups.

Why does decoding leave plus signs in my text?

In this tool only %20 becomes a space. A plus sign is a space only in HTML form data, so decode as normal and then replace any plus signs with spaces if the text came from a form or query string that used them.

Should I encode a whole URL or just parts of it?

Just the parts, such as each query value. Encoding a whole address escapes the colon and slashes as well and stops it working as a link.

Why do I get an error when I encode or decode?

Decoding fails on a stray % or an incomplete %XX sequence, such as 100%. Encoding fails only if the text contains half of an emoji or other symbol with its partner missing, which can't be written as UTF-8. Delete the broken character and try again.

Related tools