URL Encoder & Decoder

Encode plain text or URLs into percent-encoded format, or decode encoded strings back to readable text.

Plain Text / URL
Encoded Output
Component mode
Encodes everything incl. : / ? & = — use for query values
Full URL mode
Preserves : / ? & = structure — use for complete URLs
Common encodings
Space → %20 · @ → %40 · { → %7B · " → %22

Frequently asked questions

What is URL encoding?
URL encoding (also called percent-encoding) replaces characters that are not allowed in a URL with a % followed by their hex code. For example, a space becomes %20 and @ becomes %40. This ensures that URLs are valid and unambiguous across all browsers and servers.
What is the difference between Component and Full URL mode?
Component mode (encodeURIComponent) encodes everything except letters, digits, and - _ . ~ — it is for encoding individual query values like search terms or JSON strings. Full URL mode (encodeURI) preserves the URL structure characters (: / ? & = # @) and is for encoding a complete URL that already has a valid structure.
When would I use URL encoding as a developer?
Common situations: building a query string with user input that may contain special characters, passing a URL as a parameter inside another URL, sending JSON in a query parameter, encoding email addresses in mailto links, or debugging an encoded URL you received in a log or redirect.
Why does a space sometimes appear as + instead of %20?
In HTML form submissions (application/x-www-form-urlencoded), spaces are encoded as + for historical reasons. In modern URL encoding (RFC 3986), the correct encoding for a space is %20. Both are widely understood, but %20 is preferred for URLs and %2B should be used for a literal + character.
How do I URL encode a string in JavaScript?
Use encodeURIComponent(str) to encode a single value like a query parameter — it encodes all special characters including & and =. Use encodeURI(url) to encode a full URL while preserving its structure. To decode, use decodeURIComponent(encoded) or decodeURI(url) respectively.
What characters must be percent-encoded in a URL?
Characters outside the unreserved set (A–Z, a–z, 0–9, - _ . ~) must be encoded in URL components. Common ones: space → %20, # → %23, & → %26, = → %3D, + → %2B, / → %2F, ? → %3F, @ → %40. Reserved characters like / : ? & = # have special meaning in URLs and should only be encoded when used as literal data values.
How do I decode a URL that looks garbled or broken?
Paste the encoded URL into the decode box — the tool will convert all %XX sequences back to their original characters. This is useful for debugging redirect URLs, reading encoded query parameters from server logs, or decoding URLs copied from browser developer tools.