URL Encoder & Decoder

Encode URLs for safe transmission or decode percent-encoded strings back to plain text. Smart mode preserves URL structure (:// ? & =) while encoding special characters.

awaiting input
Smart encode mode: preserves :// ? & = # so full URLs remain valid. Special characters in values (spaces, brackets, non-ASCII) are percent-encoded.
Plain URL / text input
URL-encoded output (click to copy)
URL breakdown
ComponentValue

What is URL encoding?

Percent encoding
URL encoding replaces unsafe characters with a % followed by the character's hex value. A space becomes %20.
When to encode
Encode query parameters containing special characters before appending them to a URL. This prevents the server from misinterpreting &, = or # as delimiters.
Safe characters
Letters (A–Z, a–z), digits (0–9), and - _ . ~ are safe and never need encoding. Everything else should be percent-encoded.

How to Use the URL Encoder/Decoder

  1. Choose encode or decode β€” Encode converts special characters to percent-encoded format safe for URLs. Decode converts percent-encoded strings back to readable text.
  2. Enter your text or URL β€” paste the text to encode or the percent-encoded string to decode.
  3. Select encoding type β€” Full URL encoding encodes everything except URL-safe characters. Component encoding additionally encodes /, ?, &, = characters β€” use this for individual query parameter values.
  4. Copy the result β€” use the encoded URL or decoded text in your application.
  5. Verify the result β€” test encoded URLs by pasting them into a browser address bar to confirm they work as expected.
🌐 Most common use case: Encoding query parameters containing special characters: spaces, &, =, +, non-ASCII characters. 'search term' becomes 'search%20term' or 'search+term'. '&' in a value becomes '%26'. Without encoding, special characters break URL parsing and your query parameters will be misread.

Understanding URL Encoding

πŸ”€ Why URLs Need Encoding
URLs can only contain a limited set of ASCII characters. Spaces, non-ASCII characters (accented letters, Chinese, Arabic), and characters with special URL meaning (&, =, ?, /) must be encoded. Percent encoding replaces these characters with %XX where XX is the hexadecimal ASCII or UTF-8 code.
πŸ“Š Percent Encoding
Each unsafe character is replaced by a percent sign followed by its two-digit hexadecimal code. Space = %20. & = %26. = = %3D. + = %2B. / = %2F. # = %23. % itself = %25. The full list of reserved and unreserved URL characters is defined in RFC 3986.
πŸ†š %20 vs +
Both represent spaces in URLs but in different contexts. %20 is the correct encoding per RFC 3986 β€” safe in any URL context. + represents space only in query strings (form submission legacy). Using + in path segments is incorrect and may be interpreted as a literal plus sign. When in doubt, use %20.
🌍 Unicode in URLs
Non-ASCII characters (Chinese, Arabic, emojis, accented characters) are encoded by first converting to UTF-8 bytes, then percent-encoding each byte. The Chinese character 'δΈ­' (UTF-8: E4 B8 AD) becomes %E4%B8%AD in a URL. Modern browsers display international URLs in readable form (Punycode for domains, percent-decoded for paths) while sending the encoded version.
πŸ”— Query String Encoding
Query parameters require careful encoding. The parameter name and value must be separately encoded before being joined with '=', and multiple parameters joined with '&'. 'search=hello world&filter=a&b' should be 'search=hello%20world&filter=a%26b' β€” the & within the value must be encoded or it will be interpreted as a parameter separator.
⚑ Form Submission Encoding
HTML forms with method='GET' submit values as query strings with automatic URL encoding by the browser. Method='POST' with enctype='application/x-www-form-urlencoded' uses the same encoding for the request body. Understanding this encoding is essential for correctly parsing form submissions in server-side code.

URL Encoding in Development

API endpoint construction

Building API URLs programmatically requires correct encoding of all variable components. Using string concatenation without encoding is a common security vulnerability β€” if user input contains &, =, or other special characters, it can manipulate the URL structure. Use language-built-in URL construction libraries: JavaScript's URLSearchParams, Python's urllib.parse.urlencode(), Ruby's URI.encode_www_form(). These handle encoding automatically and prevent URL injection.

Debugging encoded URLs

When URLs appear in logs, error messages, or network inspector, they are often percent-encoded. Decoding reveals the actual parameter values for debugging. A URL like /search?q=hello%20world&category=%E6%8A%80%E6%9C%AF decodes to /search?q=hello world&category=ζŠ€ζœ― (the Chinese word for 'technology'). This converter makes such debugging immediate.

Deep linking and URL sharing

When generating shareable URLs containing user-entered content (search terms, filters, selected options), ensure all values are properly encoded. Unencoded spaces, apostrophes, or special characters in URLs break when copied between different systems (email clients, messaging apps, social media) that apply their own URL parsing. Always encode at URL generation time and test URLs in multiple sharing contexts.

πŸ”§ URL encoding reference: Space: %20. &: %26. =: %3D. +: %2B. /: %2F. ?: %3F. #: %23. @: %40. !: %21. $: %24. ,: %2C. ;: %3B. :: %3A. Memorise the most common ones (space, &, =) for quick manual debugging without needing a converter.

Frequently Asked Questions

What is URL encoding?
URL encoding replaces unsafe characters with a % followed by the character's two-digit hex value. A space becomes %20. It ensures URLs remain valid when containing special characters.
When do I need to URL encode?
Encode query parameter values containing special characters before appending to a URL. Example: q=hello world β†’ q=hello%20world.
What characters are safe in URLs?
Letters (A–Z, a–z), digits (0–9), and - _ . ~ are unconditionally safe. All other characters should be percent-encoded.