Wizard Toolbox Tool map

URL Encode and Decode

Type text to make it safe inside a URL, or switch to Decode to turn %20 and friends back into text.

Do

What gets encoded

Encoding makes text safe to put inside one part of an address, such as a query value or one piece of a path. Letters, digits and - _ . ! ~ * ' ( ) stay as they are; everything else becomes a % and two hex digits for each UTF-8 byte. A space becomes %20, & becomes %26, / becomes %2F and é becomes %C3%A9.

Spaces as +

HTML forms send a space as + rather than %20. Turn on Form style to encode that way, or to decode text copied from a form submission or a search address, where a + means a space.

Decoding

Switch to Decode and paste the encoded text. A % that is not followed by two hex digits is pointed out by its position, and escapes that do not make valid UTF-8 are refused rather than turned into question marks. Use as input sends the result back up the other way round.

Questions

Should I encode a whole URL with this?

No. It encodes every /, : and ?, which is right for a value going inside an address and wrong for the address itself. Encode each value, then put the address together. To see an address split into its parts, use the URL Parser.

Is this the same as JavaScript's encodeURIComponent?

Yes. Encoding gives exactly what encodeURIComponent gives, and decoding matches decodeURIComponent, with Form style adding the + for spaces.

Worked out in this page, on your device · nothing is sent anywhere