URLエンコード・デコード

URLエンコードとは何ですか?

A web address can carry only a small set of characters: the letters A to Z, the digits, and the four marks - _ . ~. Everything else, such as a space, an & or a Hindi letter, is written as a percent sign and two hex digits for every byte. A space becomes %20, an & becomes %26, and “é” becomes %C3%A9. That is why it is also called percent-encoding. Decoding is the same thing backwards.

Which style should I pick?

Standard is for one piece of a link: a search word, a parameter value, a file name. It encodes everything that is not a plain letter or digit, including : / ? # & =. Web address is for a whole link that you want to keep working. It leaves those marks alone and only fixes spaces, accents and symbols. Form is what an HTML form sends: the same as Standard, except that a space is written as a plus sign.

Pasting a whole address into Standard turns it into one long string with no slashes, which is right for putting it inside another link, and wrong for opening it.

Is a space %20 or +?

%20 works everywhere. A plus sign means “space” only inside a query string or form data (the part after the question mark), never in the path. When you decode, the option Treat + as a space decides this. It is on by default because most pasted text comes from a query. Turn it off if the plus signs are real, as in C++.

Why does it say a code is not valid?

A percent sign must be followed by two hex digits, and the bytes together must make valid UTF-8. A stray % does not, and neither does %E9 on its own, which is how some older pages wrote “é” in Latin-1. The decoder does not give up: it decodes what it can, leaves the rest as it was, and tells you.

It also warns when text you want to encode already contains percent codes. Encoding twice turns every % into %25, so %20 becomes %2520, and the link stops working.

入力したテキストはどこかに送信されますか?

No. Encoding and decoding happen in your browser, so a private link or token never leaves your device.