Skip to content

URL Encode Decode

Direction
Result —
Input characters
—
Output characters
—
Percent escapes
—

URL encoding replaces characters that are not allowed in a URL with a percent sign and two hex digits for each UTF-8 byte. A space becomes %20, an ampersand %26, and café becomes caf%C3%A9 because é is two bytes. Decoding reverses it, turning %C3%A9 back into é.

About this tool

Query strings break when a value contains an ampersand, a space or a non-English letter, and log files and redirect links are full of %XX sequences nobody can read. This converter handles both directions. Encode a single value when you are building a query parameter, encode a full URL when you only need spaces and accented characters fixed without breaking the slashes and question mark, or decode an escaped string to see what it says. The counts show how many escapes were involved, and a warning appears when text looks double-encoded. One limit: it does not convert international domain names to punycode, so a host such as münchen.de is percent-escaped rather than turned into its xn-- form.

How to use it

  1. Pick a direction

    Choose Encode a value for one parameter, Encode a full URL to keep its structure, or Decode.

  2. Paste the text

    Type or paste into the box, or open a .txt file from your device.

  3. Set form encoding if needed

    Tick the + option when the string comes from or goes to an HTML form, where spaces are written as +.

  4. Copy the result

    The converted text and the escape count update while you type; copy the result into your link or code.

Examples

Encoding café

Direction
Encode a value
Text or URL
café
Treat spaces as + (HTML form encoding)
No

Result Result: caf%C3%A9
Input characters: 4
Output characters: 9
Percent escapes: 2

  1. Kept letters, digits and – _ . ! ~ * ' ( ); everything else is escaped.
  2. Every other character was written as its UTF-8 bytes, each as %XX: 2 escapes.

The é is two bytes in UTF-8, so it becomes two escapes, %C3%A9, while the plain letters stay as they are.

A URL with a space in the path

Direction
Encode a full URL
Text or URL
https://example.com/my file.pdf?q=1
Treat spaces as + (HTML form encoding)
No

Result Result: https://example.com/my%20file.pdf?q=1
Input characters: 35
Output characters: 37
Percent escapes: 1

  1. Kept letters, digits, – _ . ! ~ * ' ( ) and the URL delimiters ; , / ? : @ & = + $ #.
  2. Every other character was written as its UTF-8 bytes, each as %XX: 1 escapes.

Full-URL mode keeps the colon, slashes, ? and = so the link still works, and only the space becomes %20.

Decoding a form-encoded value

Direction
Decode
Text or URL
na%C3%AFve+caf%C3%A9
Treat spaces as + (HTML form encoding)
Yes

Result Result: naïve café
Input characters: 20
Output characters: 10
Percent escapes: 4

  1. Found 4 percent escapes (%XX).
  2. Plus signs were read as spaces (form encoding).
  3. Each run of %XX bytes was read as UTF-8 and turned back into characters.

With form encoding on, the + becomes a space and each pair of escapes turns back into one accented letter.

How it is calculated

each byte b of the UTF-8 form of a reserved or non-ASCII character → % followed by b in two hex digits

b
one byte of the character's UTF-8 encoding (1 to 4 bytes per character)
%XX
a percent escape, with XX the byte value in upper-case hexadecimal

RFC 3986 allows letters, digits and – . _ ~ in a URL as they are. Value mode escapes everything else except ! * ' ( ), which matches JavaScript's encodeURIComponent. Full-URL mode also keeps the delimiters : / ? # @ & = + $ ; , so the address keeps its shape. Decoding groups consecutive escapes and reads them as UTF-8; a lone %E9 is rejected because it is not a complete UTF-8 character.

When not to use it

  • To turn an international domain name into its xn-- form, which needs punycode rather than percent escapes.
  • To hide or protect data, since percent-encoding is reversible by anyone and offers no secrecy.
  • For text that will be placed in HTML, which needs HTML entities such as & instead.

Common mistakes

  • Encoding a full URL in value mode, which turns the slashes and colon into %2F and %3A.
  • Encoding a string twice, so %20 becomes %2520 and the server receives a literal percent sign.
  • Forgetting that HTML forms send spaces as +, so a plain decode leaves the plus signs in place.

Frequently asked questions

What is the difference between %20 and + for a space?

Both mean a space, but in different places. %20 is the RFC 3986 escape and works anywhere in a URL. The + comes from the HTML form format application/x-www-form-urlencoded and is only read as a space in query strings and form bodies. In a path, + is a literal plus sign.

Why does one accented letter become two or more escapes?

Escapes encode bytes, not characters. Modern URLs use UTF-8, where é takes two bytes (C3 A9), Arabic letters take two, most Chinese characters take three and emoji take four. So 😀 becomes %F0%9F%98%80.

Why does decoding %E9 give an error?

In older Latin-1 pages %E9 meant é, but on its own it is not a complete UTF-8 character. The decoder reads escapes as UTF-8, as browsers do today, so it reports the problem rather than inventing a character. The UTF-8 form of é is %C3%A9.

Which characters stay unchanged when encoding a value?

Letters A to Z and a to z, digits 0 to 9, and the marks – _ . ! ~ * ' ( ). Everything else, including space, &, =, ?, / and #, is escaped so it cannot be mistaken for part of the URL structure.

How can I tell if a string was encoded twice?

Look for %25 followed by two hex digits, such as %2520. %25 is the escape for the percent sign itself. After one decode the result still contains %XX sequences, and the tool shows a warning so you can decode again.

Is the text I paste sent to a server?

No. Encoding and decoding run in your browser with the same functions browsers use for links, and nothing you paste is uploaded or stored.

Cite this tool

Using this tool in an assignment, article or report? Copy a citation, or a link for your website.

APA

Tools Directory Editorial Team. (2026, October 12). URL Encode Decode. Tools Directory. Retrieved October 26, 2026, from https://tools.milunir.com/converters/text-encoding/url-encode-decode/

MLA

Tools Directory Editorial Team. “URL Encode Decode.” Tools Directory, 12 Oct. 2026, https://tools.milunir.com/converters/text-encoding/url-encode-decode/. Accessed 26 Oct. 2026.

Chicago

Tools Directory Editorial Team. “URL Encode Decode.” Tools Directory. Last modified October 12, 2026. Accessed October 26, 2026. https://tools.milunir.com/converters/text-encoding/url-encode-decode/.

Link<a href="https://tools.milunir.com/converters/text-encoding/url-encode-decode/">URL Encode Decode – Tools Directory</a>