URL Encoder & Decoder

Encode and decode URLs and URI components — free, instant, no server

Text / URL to Encode
Encoded Output

How URL Encoding Works

Reserved characters

Characters like & = + # ? have special meaning in URLs. When used as data (not structure), they must be percent-encoded.

Percent encoding

Each unsafe byte is replaced with %XX where XX is the hex value. Space = %20, & = %26.

Query parameters

Always encode values in query strings. ?q=hello world should be ?q=hello%20world.

Frequently Asked Questions

URL encoding (percent-encoding) converts special characters into a format safe for URLs. Spaces become %20, ampersands become %26, and non-ASCII characters are represented as their UTF-8 bytes in hex.

encodeURI encodes a full URL, leaving structural characters like : / ? # & intact. encodeURIComponent encodes a single component value and also encodes those structural characters. Use encodeURIComponent for query parameter values.

In HTML form submissions (application/x-www-form-urlencoded), spaces are encoded as +. In proper percent-encoding, spaces are %20. Both are valid in different contexts. This tool uses %20 (encodeURIComponent).

encodeURIComponent('hello world & more')hello%20world%20%26%20more. To decode: decodeURIComponent(encoded).

Related Tools