Ad Space

Position: header

URL Encoder/Decoder

Encode or decode URLs and URI components instantly. Choose between full URL encoding (encodeURI) and component encoding (encodeURIComponent) with real-time results.

Developer Tool

Uses encodeURIComponent / decodeURIComponent — encodes everything for use inside query parameters

Enter text above to see the encoded result in real time

How to Use

  1. 1Paste a URL or text string into the input field.
  2. 2Click Encode to percent-encode special characters for safe URL use.
  3. 3Or paste an encoded URL and click Decode to see the readable original.
  4. 4Toggle between encoding the full URL or just the component (query parameter value).
  5. 5Copy the result for use in your application or browser.

About This Tool

The URL Encoder/Decoder converts between readable text and percent-encoded URL strings. It handles both full URL encoding and component encoding, which treat reserved characters differently.

URL encoding replaces unsafe characters with percent-encoded equivalents (space becomes %20, & becomes %26). This is necessary because URLs have a strict character set — characters like spaces, ampersands, and non-ASCII letters would break URL parsing if included literally.

The distinction between full URL encoding and component encoding is important. Full URL encoding preserves characters like /, ?, and & that have structural meaning in URLs. Component encoding (encodeURIComponent in JavaScript) encodes everything except unreserved characters, making it safe for query parameter values that might contain these characters.

Real-world debugging often involves decoding URLs from server logs, analytics tools, or error reports where the percent-encoding makes the actual query parameters unreadable. Paste in a URL like "search?q=hello%20world%26lang%3Den" and immediately see the human-readable version. All processing is local — your URLs are never sent to a server.

Tips & Best Practices

  • Use component encoding (encodeURIComponent equivalent) for query parameter values, and full URL encoding for complete URLs — using the wrong one is a common source of double-encoding bugs.
  • If you see %2520 in a URL, the space was double-encoded (%25 is an encoded %, and 20 represents the space). Decode twice to get the original value.
  • Non-ASCII characters in URLs (like accented letters) are first UTF-8 encoded, then percent-encoded. The tool handles this automatically, but be aware when debugging multilingual URLs.

Frequently Asked Questions

What is URL encoding (percent encoding)?
URL encoding, also called percent encoding, replaces unsafe or reserved characters in a URL with a percent sign (%) followed by two hexadecimal digits representing the character's ASCII code. For example, a space becomes %20 and an ampersand becomes %26. This ensures URLs are transmitted correctly across the internet.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL but preserves characters that are valid in a URL, such as :, /, ?, #, &, and =. encodeURIComponent encodes everything except letters, digits, and a few special characters (- _ . ! ~ * ' ( )), making it ideal for encoding query parameter values, path segments, or any string that will be embedded inside a URL.
When should I use encodeURIComponent instead of encodeURI?
Use encodeURIComponent when encoding individual query parameter values, form field values, or any string that will be placed inside a URL component. Use encodeURI only when encoding a complete URL where you want to preserve the URL structure (protocol, slashes, query delimiters). In most practical cases, encodeURIComponent is the safer choice.
What characters are encoded by URL encoding?
URL encoding targets characters that have special meaning in URLs (reserved characters like &, =, ?, #, /) and characters that are not allowed in URLs (spaces, non-ASCII characters, control characters). The exact set depends on whether you use encodeURI or encodeURIComponent. encodeURIComponent encodes a broader set of characters for maximum safety.
How do I URL-encode data for API requests?
When sending data as query parameters in an API request, use encodeURIComponent on each parameter name and value individually, then join them with & signs. For example: "key=" + encodeURIComponent(value). Most HTTP client libraries (fetch, axios) handle this automatically when you pass params as objects, but manual encoding is needed when building URLs as strings.

Ad Space

Position: sidebar

Ad Space

Position: below-fold