URL Encoder & Decoder
Encode and decode URLs with standard, component, or RFC 3986 encoding and auto-detect
Input Plain Text
Output Encoded
Options
URL Encoding Reference (Click to expand)
Common Encodings
| Character | Encoded | Description |
|---|---|---|
space | %20 / + | Space character |
! | %21 | Exclamation |
# | %23 | Hash/Pound |
$ | %24 | Dollar |
& | %26 | Ampersand |
+ | %2B | Plus |
/ | %2F | Slash |
= | %3D | Equals |
? | %3F | Question mark |
@ | %40 | At sign |
When to Use
- urlencode For query string parameters (spaces become +)
- rawurlencode For URL path components (spaces become %20)
- RFC 3986 For strict standard compliance
What is URL Encoder / Decoder?
URL Encoder Decoder is an online tool that encodes text and URLs for safe use in web addresses, and decodes encoded strings back to their original form. You switch between Encode and Decode modes, enter your text in the input area, and see the result in the output area. Encoding converts special characters (spaces, symbols, non-ASCII characters) into percent-encoded form (e.g., space becomes %20, plus becomes %2B). Decoding reverses this: %20 becomes space, %2B becomes plus. The tool supports multiple encoding types: Standard (urlencode), URL Component (rawurlencode), and RFC 3986 Compliant. An Auto-detect button can identify whether the input is encoded or plain. A swap button exchanges input and output for quick iteration. Byte and character counts are shown. Copy buttons let you copy the output easily. The tool is useful for developers building URLs, API parameters, or form data, and for anyone who needs to encode or decode URL components.
URLs can contain only a limited set of characters. Letters, digits, and a few symbols (like hyphen and underscore) are allowed unencoded. Spaces, ampersands, equals signs, and other characters must be encoded when they appear in a URL path or query string. Encoding replaces each such character with a percent sign followed by its hexadecimal code. For example, a space (ASCII 32) becomes %20. The plus sign is often used to represent space in query strings (application/x-www-form-urlencoded), but in other URL contexts %20 is correct. Different encoding schemes handle these edge cases differently. The URL Encoder Decoder lets you choose the scheme that matches your use case.
Standard encoding (urlencode) follows PHP urlencode behavior: space becomes + in addition to the percent form. It is commonly used for query strings. URL Component (rawurlencode) follows rawurlencode: space becomes %20, plus is encoded as %2B. It is suitable for path segments and components. RFC 3986 Compliant encoding follows the URI standard more strictly. The tool applies the selected scheme when encoding and interprets accordingly when decoding. For decode mode, the tool typically handles all common percent-encoded sequences and converts + to space where appropriate.
Real-time or debounced updates show the output as you type. The tool displays both byte count and character count, useful when you need to stay within length limits for URLs or APIs. The swap button moves the output to the input and vice versa, so you can encode, copy, then paste back and decode to verify. Auto-detect attempts to determine if the input looks encoded (contains %xx patterns) and may suggest or apply decode. The tool runs in the browser; for encode operations that do not require a server, data may stay local. Check the implementation for decode, as some character sets may need server-side processing.
The encode and decode modes serve complementary needs. When building a URL or API request, you encode parameter values to ensure special characters do not break the URL. When receiving or debugging a URL, you decode to see the original values. The tool supports both in one interface. Switch modes with a click. The output of encode can become the input of decode to verify round-trip. The byte and character counts help when URLs have length limits. Some systems impose limits on URL length (e.g., 2048 characters in older browsers). Knowing the encoded length helps you stay within bounds. The tool also helps with debugging: when a parameter value appears garbled in a URL, paste the URL (or the parameter part) and decode to see what was intended. Double-encoding produces %25 instead of %; decoding once reveals the still-encoded form. Decoding twice recovers the original. The tool supports this iterative decoding. For developers learning URL encoding, the tool is educational: encode a string, observe the output, decode to confirm. Understanding percent-encoding is foundational for web development; the tool makes it concrete.
Use cases include building query strings for APIs, encoding form field values, creating shareable links with special characters, debugging URL encoding issues, and decoding URLs received from logs or user input. Developers often need to encode a parameter value before appending it to a URL. Non-ASCII characters (accented letters, emoji, etc.) must be encoded in UTF-8 percent form for URLs. The tool handles these cases when the encoding scheme supports them.
Who Benefits from This Tool
Web developers use URL Encoder Decoder when building links, API calls, or form submissions. Backend developers use it to verify how parameters should be encoded. Frontend developers use it when constructing URLs in JavaScript. QA engineers use it to test URLs with special characters. Support staff use it to decode URLs that users report as broken or garbled. Anyone who works with URLs and needs to handle special characters benefits from this tool.
Key features
Encode and Decode Modes
Switch between Encode (plain to encoded) and Decode (encoded to plain). The interface adapts labels and behavior for each mode.
Encoding Types
Standard (urlencode), URL Component (rawurlencode), and RFC 3986. Choose the type that matches your context (query string, path, etc.).
Auto-detect
Button to detect if input appears encoded and optionally decode. Useful when you are unsure of the input format.
Swap and Copy
Swap exchanges input and output. Copy copies the output to the clipboard. Byte and character counts displayed.
How to use
- Select Encode or Decode mode.
- Enter your text in the input area. For encode: plain text or URL. For decode: encoded string.
- If encoding, choose encoding type (Standard, Component, RFC 3986). Use Auto-detect if decoding and unsure.
- Review the output. Use swap to exchange input/output, or copy the output.
Common use cases
- Encoding query parameters for API URLs
- Building links with special characters or non-ASCII text
- Decoding URLs from logs or user reports
- Testing URL handling with encoded values
- Encoding form data for POST body or query string
- Creating shareable links with accented characters
- Debugging "broken" or garbled URLs
- Preparing strings for safe use in URLs
Tips & best practices
Use the encoding type that matches your context. For query strings in forms, Standard is often used. For path segments or strict compliance, use RFC 3986 or Component. Always encode user input before putting it in a URL; never trust that input is safe. When decoding, be aware that double-encoding can occur if a string was encoded twice; you may need to decode multiple times. Verify the result in your actual application; encoding behavior can vary by language and library.
Limitations & notes
Encoding schemes differ by context. The tool provides common options; your specific use case (framework, API) may require a particular scheme. Very long input may have performance implications. Decoding malformed percent-sequences may produce unexpected output. Non-UTF-8 encodings may not decode correctly if the tool assumes UTF-8.
FAQs
What is the difference between Standard and RFC 3986?
When should I use encode vs decode?
Does it handle Unicode?
What does Auto-detect do?
Can I encode a full URL?
Why does my encoded string look different from another tool?
Is the data sent to a server?
Can I decode double-encoded strings?
What characters need encoding?
Does it work with Unicode emoji?
What happens if I encode an already-encoded string?
When should I use the swap button?
Encoding Standards and Context
URL encoding standards have evolved. The original application/x-www-form-urlencoded format used + for space and a limited set of reserved characters. RFC 3986 later defined a stricter URI encoding that uses %20 for space and encodes more characters. The choice of encoding type affects how your URLs behave in different contexts. Query strings in HTML forms often use the standard (plus-for-space) encoding. Path segments and RFC 3986-compliant APIs use %20. When integrating with third-party APIs, check their documentation for the expected encoding. Using the wrong type can cause 404s (if the path is wrong) or parameter parsing errors (if the query string is wrong). The URL Encoder Decoder lets you test both encode and decode, so you can verify how a string will look when encoded and how it will be interpreted when decoded by a server or library.
Percent-encoding represents each byte as % followed by two hex digits. For ASCII characters, this is straightforward: space is %20, plus is %2B. For Unicode characters, the bytes of the UTF-8 representation are each percent-encoded. For example, the character é (U+00E9) is encoded in UTF-8 as the two bytes C3 A9, so it becomes %C3%A9. The decoder must know the character encoding to convert percent-encoded bytes back to characters; UTF-8 is the default for the web. When decoding, if you see mojibake (garbled characters), the original may have been in a different encoding. The tool assumes UTF-8 for both encode and decode in most implementations. For legacy systems using other encodings, you may need a different tool or library.
Practical debugging often involves tracing encoding issues. A user reports a "broken link" that looks correct in the address bar. The problem may be double encoding: a value was encoded, then encoded again when building the URL. The result has %25 in place of %, and the server decodes once to get the original encoded form, not the plain value. Using the decoder, you can manually decode step by step to see what the server receives. Conversely, when a link fails because of special characters, encode the problematic part and rebuild the URL. The swap button is useful here: encode, copy, paste into your app, then if it fails, paste the URL back and decode to inspect. The tool supports iterative debugging of encoding issues.
API and Query String Construction
When building API requests, parameter values often need encoding. A search API might accept a query parameter. If the user searches for "hello world", the parameter value must be encoded before appending to the URL. Using Standard encoding, "hello world" becomes "hello+world" or "hello%20world" depending on the scheme. The URL Encoder Decoder lets you test: type "hello world", select Encode, choose the encoding type your API expects, and copy the result. Append it to the base URL. When the API returns a URL or when you receive encoded parameters in a callback, use Decode to see the original values. Many API integrations fail due to encoding mismatches. The client encodes one way; the server expects another. The tool helps you verify both sides. For OAuth and other authentication flows, state and redirect parameters often contain encoded values. The tool supports debugging these flows. Copy the encoded string from the URL, paste into the decoder, verify the content. Byte and character counts help when APIs impose length limits. Stay within bounds by checking the encoded length before sending.
Form Data and Multi-Part Encoding
HTML forms use application/x-www-form-urlencoded by default. Form field names and values are encoded with spaces as plus signs. The URL Encoder Decoder's Standard mode matches this. When constructing form data manually (e.g., for a fetch or XMLHttpRequest), encode each field name and value. The tool helps you get the exact string to use. For file uploads, multipart/form-data is used; encoding is different there. But for simple key-value form data, the Standard encoding is correct. When parsing form data on the server, the server decodes automatically. When building it on the client, you must encode. The tool bridges the gap: encode on the client side, verify the output, use it in your request. For query strings in GET requests, the same encoding applies. The entire query string (the part after ?) is composed of encoded key=value pairs. Use the tool to encode individual values. Building URLs programmatically usually involves library functions (encodeURIComponent in JavaScript, urlencode in PHP). The tool is for manual verification and learning. When library output differs from expectation, use the tool to compare.
Testing and Verification Workflows
When integrating with third-party APIs, encoding behavior can cause subtle bugs. The URL Encoder Decoder supports verification: encode a test value, copy the result, use it in your request, and check the response. If the server rejects or misparses the parameter, try a different encoding type. Standard, Component, and RFC 3986 produce different output for edge cases like space and plus. Document which encoding your API expects and use the tool to generate test vectors. For automated testing, the tool's output can inform your test fixtures. Manual verification remains valuable when debugging; the tool provides immediate feedback without writing code. The swap and copy buttons streamline the iterative process: encode, copy, test, decode response, compare. The tool is a companion for URL-related development and debugging.
International Characters and Emoji in URLs
URLs were originally ASCII-only. Non-ASCII characters (accented letters, Chinese characters, emoji) must be encoded. UTF-8 is the standard encoding for the web. Each character is converted to its UTF-8 byte sequence, and each byte is percent-encoded. For example, "café" encodes to "caf%C3%A9" because é in UTF-8 is the bytes C3 A9. The URL Encoder Decoder handles this when UTF-8 is the character set. Paste "café", encode, and see the result. Decode to verify round-trip. Emoji are multi-byte in UTF-8; the encoded form can be long. The tool supports it. When building URLs with search terms in different languages, encoding ensures the URL is valid. Browsers and servers handle the encoding when you type in the address bar or submit a form, but when constructing URLs in code or configuration, manual encoding is sometimes needed. The tool provides a reference. Test with your actual strings. Ensure your application uses UTF-8 consistently; mixing encodings causes mojibake (garbled characters) when decoding.