URL Encoder / Decoder

Encode or decode URLs, query parameters, and special characters. Everything runs in your browser.

0 characters
0 characters
encodeURIComponent / decodeURIComponent β€” encodes all special characters

What Is URL Encoding?

URL encoding (percent-encoding) converts characters into a format that can be safely transmitted in a URL. Characters like spaces, ampersands, and non-ASCII letters are replaced with a percent sign followed by two hex digits β€” for example, a space becomes %20.

When Do You Need URL Encoding?

  • Passing user input as query parameters (?q=hello%20world)
  • Including special characters in URL paths
  • Encoding non-ASCII characters (Chinese, Japanese, Arabic) in URLs
  • Building API requests with dynamic values
  • Fixing broken links caused by unescaped characters

encodeURIComponent vs encodeURI

JavaScript provides two built-in functions for URL encoding. encodeURIComponent() encodes all special characters including :, /, ?, #, and &. Use it for encoding individual query parameter values. encodeURI() preserves URL structure characters and only encodes characters that are invalid in any part of a URL. Use it when encoding a complete URL.

Common URL Encoding Examples

  • Space β†’ %20 (or + in form data)
  • & β†’ %26
  • = β†’ %3D
  • ? β†’ %3F
  • # β†’ %23
  • / β†’ %2F

URL Decoding

URL decoding reverses percent-encoding back to the original characters. This is useful when reading log files, debugging API requests, or extracting readable text from encoded URLs. Switch to decode mode above to convert any percent-encoded string back to plain text.

URL Encoding for Different Languages

Non-ASCII characters like ζ—₯本θͺž, Ü, or cafΓ© are first converted to their UTF-8 byte sequences, then each byte is percent-encoded. Modern browsers handle this automatically in the address bar, but API calls and backend code often require explicit encoding.

Related Tools

For creating clean URL slugs, use the URL Slug Generator. For converting text formats, try the Case Converter. For cleaning text before encoding, see the Plain Text Converter.

Related Tools