URL Encoder / Decoder

Encode or decode URL components (percent-encoding).

Developer

About URL Encoder

URL encoding (also called percent-encoding) is the standard method for representing special characters in URLs. The URI specification (RFC 3986) defines a set of "unreserved" characters (letters, digits, hyphens, underscores, periods, tildes) that can appear in URLs as-is. All other characters — including spaces, ampersands, equals signs, slashes, and non-ASCII characters — must be encoded as a percent sign followed by their two-digit hexadecimal value (e.g., %20 for space, %26 for &).

This tool encodes text using the same rules as JavaScript's encodeURIComponent() function and decodes using decodeURIComponent(). This makes the output suitable for use in query string parameters, form data, and API request URLs. Since all processing happens in your browser, your data remains completely private.

How to Use URL Encoder

  1. Type or paste the text you want to encode (or a percent-encoded string you want to decode) into the Input area.
  2. Select Encode to convert special characters to percent-encoding, or Decode to convert percent-encoded strings back to readable text.
  3. The result appears instantly. Use Copy result to copy it to your clipboard.

Key Features

  • Encode & decode — Bidirectional conversion between text and percent-encoded format
  • Web-standard compliant — Uses encodeURIComponent/decodeURIComponent rules per RFC 3986
  • Handles all characters — Encodes spaces, ampersands, Unicode, and all special characters
  • Instant results — Output updates immediately as you type
  • One-click copy — Copy the encoded/decoded result to your clipboard
  • 100% client-side — No server communication; your data stays private

When to Use This Tool

  • Building URLs with query parameters that contain spaces or special characters
  • Encoding user input before appending it to API request URLs
  • Decoding percent-encoded strings from log files or analytics
  • Preparing form data for URL-encoded POST requests
  • Debugging URL issues where characters are being double-encoded

Technical Details

The encoding follows RFC 3986 via JavaScript's encodeURIComponent(), which encodes all characters except: A-Z, a-z, 0-9, hyphen (-), underscore (_), period (.), and tilde (~). Notably, this function also encodes characters that have special meaning in URLs such as /, ?, #, &, and =, making the output safe for use within individual query parameter values. Decoding uses decodeURIComponent(), which reverses the percent-encoding. Non-ASCII characters (e.g., accented letters, emoji) are first encoded to UTF-8 bytes, then each byte is percent-encoded. All processing runs in JavaScript within your browser.

Conclusion

URL Encoder is an essential web development tool for ensuring special characters are safely transmitted in URLs and query strings. With RFC 3986 compliance, bidirectional encoding/decoding, and complete browser-side privacy, it handles all your URL encoding needs. For breaking down URL components, try the URL Parser.

Frequently Asked Questions

What is URL encoding?
URL encoding (percent-encoding) converts special characters into %XX format so they can be safely used in URLs. For example, a space becomes %20 and & becomes %26.
Is my data sent to a server?
No. Encoding and decoding happen entirely in your browser using JavaScript. Your text never leaves your device.
When should I encode vs. decode?
Encode when building URLs with query parameters or path segments that contain spaces or special characters. Decode when you have a percent-encoded string and need to read the original text.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL but preserves characters like /, ?, #, and &. encodeURIComponent encodes everything except letters, digits, and a few symbols, making it safe for individual query parameter values. This tool uses encodeURIComponent.