URL encoder and decoder

Percent-encode or decode a complete URL or one component. Choose component mode for a query value, path segment, or other individual piece of data.

URL mode or component mode

Link

Encode URL uses encodeURI(). It preserves characters that structure a complete URL, including :, /, ?, #, and &. Encode component uses encodeURIComponent() and encodes those separators when they are part of a value.

For example, component mode converts tea & cake to tea%20%26%20cake. If that value is used in ?q=, encoding the ampersand prevents it from being mistaken for the start of another parameter. Do not apply component mode to a complete URL because it will also encode its structural separators.

Percent encoding represents UTF-8 bytes as % followed by two hexadecimal digits. It is not limited to ASCII character codes. A space becomes %20; form encoding may instead use +, but this widget does not perform form encoding. Decoding malformed percent sequences produces an error.

Privacy and storage

Link

Processing happens in your browser. The input and selected action are saved in localStorage. Clear them after handling sensitive URLs or tokens on a shared device.

Link

Further reading

Link

Widget made with staark