URL Encoder/Decoder

Encode text to URL-safe format and decode URL-encoded strings. Perfect for working with query parameters and special characters.

What is URL Encoder/Decoder?

URL Encoding, also called percent-encoding, is a mechanism for converting characters that are not allowed or have special meaning in URLs into a universally safe format. The URL specification (RFC 3986) restricts which characters can appear unescaped in a URL—only letters (A–Z, a–z), digits (0–9), and a few symbols (-._~) are considered 'unreserved' and safe everywhere. All other characters, including spaces, ampersands, equals signs, hash symbols, non-ASCII characters, and Unicode text, must be encoded as a percent sign followed by two uppercase hexadecimal digits representing the character's byte value (for example, a space becomes %20, and & becomes %26). URL encoding is essential in everyday web development: when building query strings dynamically in JavaScript, when constructing API request URLs that include user-supplied search terms, when passing file paths or email addresses as URL parameters, or when working with internationalized URLs (IDNs) that contain accented letters or CJK characters. Without proper encoding, URLs break silently—a space in a query parameter can truncate the value, an unencoded # is interpreted as a fragment identifier, and unencoded + signs are sometimes treated as spaces by servers.

How to Use URL Encoder/Decoder

Paste your URL or text string into the input field. Choose the encoding mode: 'Encode entire text' converts every character that is not URL-safe (useful for encoding a plain text string you want to embed in a URL parameter), or 'Encode query parameters only' preserves the URL structure (protocol, slashes, domain, path) while encoding only the query string values—the smarter choice when working with full URLs. Click Encode to perform the conversion. The output shows the percent-encoded version ready to use in HTTP requests, API calls, or HTML href attributes. To decode: paste a percent-encoded URL or query string and click Decode to recover the original human-readable text. This is useful for understanding encoded URLs from server logs, analytics reports, or redirect chains. Common decoded values include search queries, email addresses in mailto links, or file paths in download URLs. Click Copy to copy the output instantly.

FAQ

What is the difference between %20 and + for spaces?

Both represent a space in URLs, but in different contexts. %20 (percent-encoding) is the correct encoding for spaces in any part of a URL according to RFC 3986. The + symbol represents a space only within HTML form-encoded query strings (application/x-www-form-urlencoded), not in the URL path. Modern APIs prefer %20 for universal compatibility. Use + only when working with traditional HTML form submissions.

Should I encode the full URL or only the query parameters?

It depends on your input. If you have a complete URL like https://example.com/search?q=hello world, use 'Encode query parameters only'—this preserves the structural characters (://, /, ?) and only encodes the values (hello world → hello%20world). If you have a raw text value that will become part of a URL parameter, use 'Encode entire text' to make it fully safe for embedding.

Which characters are NOT encoded?

RFC 3986 defines 'unreserved characters' that are never encoded: uppercase and lowercase letters (A–Z, a–z), digits (0–9), and four symbols: hyphen (-), underscore (_), period (.), and tilde (~). Structural URL characters like /, ?, =, &, and # are also preserved when using the 'Encode query parameters only' mode since they define the URL structure.

How do I handle non-English characters in URLs?

Non-ASCII characters like accented letters (é, ü, ñ) or CJK characters (中文, 한국어) are first converted to their UTF-8 byte sequences, then each byte is percent-encoded. For example, the Korean character 한 encodes as %ED%95%9C. This is the standard approach for internationalized URLs (IRIs). This tool handles UTF-8 encoding automatically.

Is URL encoding the same as HTML encoding?

No. URL encoding (percent-encoding) is for making text safe inside URLs. HTML encoding (HTML entities) is for making text safe inside HTML markup—for example, & becomes &amp;, < becomes &lt;, and > becomes &gt;. You need URL encoding when building URLs, and HTML encoding when inserting user content into HTML. Sometimes both are needed—for example, when a URL appears in an HTML href attribute.