URL Encoder / Decoder

Free

Encode or decode URLs and query strings instantly. Supports full URLs and components.

Type:

What is URL Encoding?

URL encoding (percent-encoding) is a mechanism for encoding special characters in URLs. Because URLs can only contain certain ASCII characters, any data that falls outside that set — including spaces, special symbols, and non-ASCII characters — must be encoded before being included in a URL.

encodeURIComponent vs encodeURI

encodeURIComponent

Encodes all characters except: A-Z a-z 0-9 - _ . ! ~ * ' ( ). Use this for individual query parameter values.

encodeURI

Encodes all characters except those used in URL syntax: A-Z a-z 0-9 ; , / ? : @ & = + $ - _ . ! ~ * ' ( ) #. Use this for a complete URL.

Frequently Asked Questions

What is URL encoding?

URL encoding (also called percent-encoding) replaces special characters in a URL with a percent sign followed by two hexadecimal digits. For example, a space becomes %20. This is required because URLs can only contain a limited set of ASCII characters.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL and preserves characters that have special meaning in URLs like /, ?, #, and &. encodeURIComponent encodes a URL component (like a query parameter value) and encodes those special characters too. Use encodeURIComponent for individual parameter values.

When should I encode a URL?

You should encode a URL when it contains special characters like spaces, &, =, +, %, or non-ASCII characters (like accented letters or emoji). Always encode query parameter values using encodeURIComponent before constructing URLs.

Is this tool safe to use with sensitive data?

Yes. This tool runs entirely in your browser. No data is sent to any server.

What characters does URL encoding affect?

URL encoding replaces characters outside the unreserved set (A-Z, a-z, 0-9, -, _, ., ~) with their percent-encoded equivalents. Spaces become %20 (or + in some contexts), & becomes %26, = becomes %3D, and so on.

Related Tools