Advertisement 728×90
Advertisement 320×50

URL Encoder / Decoder

Encode or decode URL components and full URLs — handles percent-encoding, spaces, and special characters.

Encode Component — encodes a query parameter value (encodeURIComponent)
Decode — decodes any percent-encoded string (decodeURIComponent)
Encode Full URL — encodes a complete URL, preserving :/?#&= (encodeURI)
Also try: Base64 Encoder · JSON Formatter
Advertisement 300×250
Advertisement 728×90
Quick Answer

Use "Encode Component" for query parameter values (encodes & = ? and more). Use "Encode Full URL" to encode a complete URL while preserving its structure. Use "Decode" to convert %xx sequences back to readable text.

What is URL encoding (percent-encoding)?

URLs can only contain a limited set of characters defined by the RFC 3986 standard. Any character outside this set — including spaces, accented letters, emoji, and many punctuation marks — must be encoded as a percent sign (%) followed by the character's two-digit hexadecimal value. For example: space → %20, © → %C2%A9, # → %23.

encodeURIComponent vs. encodeURI

encodeURIComponent is the most commonly needed function. It encodes all characters except letters, digits, and - _ . ! ~ * ' ( ). Use it for any value you're placing inside a query string. encodeURI is for encoding a complete URL — it doesn't encode : / ? # [ ] @ ! $ & ' ( ) * + , ; = since those have structural meaning in a URL.

Common encoding examples

Space → %20 or +, & → %26, = → %3D, + → %2B, / → %2F, ? → %3F, # → %23, @ → %40, % → %25. When building URLs programmatically, always encode user-provided values before including them in query strings to prevent injection attacks.

Frequently asked questions

What is URL encoding?

URL encoding converts characters not allowed in a URL into a percent sign followed by two hexadecimal digits. For example, a space becomes %20 and an ampersand becomes %26. This ensures URLs are transmitted correctly.

What does %20 mean in a URL?

%20 is the URL-encoded representation of a space character. URLs cannot contain spaces, so they are replaced with %20. The 20 is the hexadecimal ASCII code for a space.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a complete URL, leaving structural characters like ://?=& unchanged. encodeURIComponent encodes a component value and also encodes those structural characters. Use encodeURIComponent for query parameter values; encodeURI for full URLs.

When do I need to encode a URL?

You need to encode URLs when they contain spaces, non-ASCII characters, or special characters with meaning in URLs (&, =, #, ?). Always encode query parameter values before appending them to a URL.