Skip to contentSkip to the inputSkip to the result

URL encoder & decoder

Encode a query value or restore percent-encoded text.

Loading tool

Instructions

URL encoder & decoder

How to use

  1. Choose encode or decode and paste the URL component to convert.

Supported input

  • Encodes one component or a whole address.
  • A plus sign is decoded as a space only when asked; a stray % is left as typed.

Input example

한글

Result example

%EC%84%9C%EC%9A%B8%20%EC%97%AD

Troubleshooting

  • Check required inputs, numeric ranges and the selected conversion direction.

How it works

  • Encode a query value or restore percent-encoded text.

Percent-encoding a URL: which characters change, and how much to encode

Typical jobs

  • Building a query string by hand for curl or an API client, with non-ASCII text and symbols in the values
  • Reading a search term or file name that an access log recorded as %E2%82%AC-style codes
  • Putting one URL inside another as a parameter, such as the page to return to after login
  • Peeling a double-encoded link (one full of %25) back one layer at a time to see where it went wrong

Safe characters and meaningful ones

RFC 3986 calls letters, digits and the four marks - . _ ~ unreserved: they never need encoding. The delimiters : / ? # [ ] @ and ! $ & ' ( ) * + , ; = may carry structure, so inside a value they have to be written as % followed by two hex digits. Everything else, accented letters, Korean or emoji, is turned into UTF-8 bytes and each byte gets its own %XX.

The One value mode uses encodeURIComponent, which encodes slightly less than that rule. It leaves ! ' ( ) * alone, so it's (a) test!* comes out as it's%20(a)%20test!*. Servers almost always read that fine. A calculation that follows RFC 3986 to the letter does not: OAuth 1.0 signatures (RFC 5849, section 3.6) require every character except the unreserved ones to be encoded, so those five need replacing with %21, %27, %28, %29 and %2A yourself.

Worked example: a return URL as a parameter

  1. 1The address to carry is https://example.com/next?page=2&q=서울, a search for Seoul.
  2. 2As One value it becomes https%3A%2F%2Fexample.com%2Fnext%3Fpage%3D2%26q%3D%EC%84%9C%EC%9A%B8. Appended after login?next=, its & and ? can no longer split the outer address.
  3. 3As A whole address only the Korean is encoded: https://example.com/next?page=2&q=%EC%84%9C%EC%9A%B8. Put that after next= and the &q=… part is read as a new parameter of the outer URL.
  4. 4Encoding the first result again turns every % into %25: https%253A%252F%252F… A server that decodes once is left with %3A in the address. When a link breaks, look for %25 followed by two hex digits; that is the sign of double encoding.

What whole-address mode leaves alone

Decoding as A whole address uses decodeURI, which does not decode the codes of structural characters. %2F becomes / as One value but stays %2F as A whole address, and a+b%2Bc gives a+b+c in the first mode and a+b%2Bc in the second. Turning %2F into / inside a path would add a folder level that was never there.

Encoding works the same way. a b+c becomes a%20b%2Bc as One value but a%20b+c as A whole address, with the + untouched. A server that reads the query with form rules (application/x-www-form-urlencoded) takes that + as a space, so use One value whenever a literal + matters. Browsers submitting forms, and URLSearchParams, write a space as + (서울 역 a+b gives %EC%84%9C%EC%9A%B8+%EC%97%AD+a%2Bb); this tool writes %20, which form parsers also read as a space.

Broken percent sequences

  • A lone % in ordinary text is kept. 100% 할인 %EC%84%9C%EC%9A%B8 decodes to 100% 할인 서울: only the valid runs of %XX are decoded.
  • A UTF-8 sequence cut short is left as typed rather than guessed at: %ED%95, the first two of the three bytes of one Korean syllable, stays %ED%95. A % left in the result usually means the source was truncated.
  • Decoding text that was already decoded can destroy a real % inside it. Decode once, and decode again only if %XX codes are still visible.

Checked

Frequently asked questions

What is the difference between One value and A whole address?

One value uses encodeURIComponent and also encodes symbols such as & = ? /. A whole address uses encodeURI and keeps the address structure. For example, a b&c=한 as one value becomes a%20b%26c%3D%ED%95%9C.

Why does + not turn into a space when decoding?

Standard percent-decoding leaves + as it is. For form data or search addresses, where + means a space, set + sign to Read as a space, and a+b%20c becomes a b c.

Why does one Korean character become three % codes?

Korean takes 3 bytes in UTF-8 and each byte is written as % plus two hex digits. So 한 becomes %ED%95%9C, 9 characters. A broken or cut-off sequence fails to decode.