URL Encoder & Decoder

Encode special characters into RFC 3986 percent-encoding and decode back live

Simultaneously encode and decode URLs and query string values in real time using standard UTF-8 percent-encoding (`encodeURIComponent` / `decodeURIComponent`).

Key Features & Specifications

  • Simultaneous real-time encoding and decoding via `encodeURIComponent` and `decodeURIComponent`
  • Full UTF-8 multi-byte percent-encoding support for Hindi text, symbols, and emojis
  • Built-in `URIError` detection for malformed percent sequences

How to Use URL Encoder & Decoder

  1. Paste or type your URL or query string into the input box.
  2. Inspect both the 'Encoded (RFC 3986)' and 'Decoded' output boxes as they update automatically in real time.
  3. Click 'Copy' next to either the encoded or decoded output to copy the string to your clipboard.

Comprehensive Educational Guide & Format Insights

URLs (Uniform Resource Locators, standardized under RFC 3986) can only be transmitted reliably across the internet using a limited subset of printable ASCII characters. Whenever a URL or query parameter contains spaces, non-ASCII Unicode characters (such as Hindi Devanagari text or emojis), or reserved syntax delimiters (`?`, `&`, `=`, `#`, `/`, `:`), those characters must be converted into 'percent-encoding'—where each UTF-8 byte is represented by a percent sign followed by two hexadecimal digits (for example, a space becomes `%20` and an ampersand `&` becomes `%26`). Our URL Encoder & Decoder processes your input instantaneously as you type, displaying both the `Encoded (RFC 3986)` output and the `Decoded` output side by side with one-click copy buttons.

Under the hood, this tool uses JavaScript's built-in `encodeURIComponent()` and `decodeURIComponent()` functions. Understanding how `encodeURIComponent()` behaves is vital for web developers: unlike `encodeURI()` (which leaves full-URL structural characters like `https://`, `/`, `?`, and `&` untouched), `encodeURIComponent()` encodes every reserved delimiter—turning `:` into `%3A`, `/` into `%2F`, `?` into `%3F`, and `=` into `%3D`—while leaving only unreserved characters (`A–Z`, `a–z`, `0–9`, `-`, `_`, `.`, `!`, `~`, `*`, `'`, `(`, `)`) unencoded. This makes `encodeURIComponent()` the safest choice when encoding an individual query parameter value (such as `?redirect=` or `?query=`) so embedded `&` or `=` symbols do not accidentally split your URL parameters.

When copying or debugging encoded strings, watch out for two common pitfalls. First, if you paste a complete URL (`https://example.com/page?q=hello`) into `encodeURIComponent()` and use the entire encoded result (`https%3A%2F%2Fexample.com...`) directly as an HTML `<a href="...">` link, browsers will treat it as a broken relative path because the `:` and `/` in `https://` were percent-encoded; only use full-URL component encoding when passing one URL inside another URL's query parameter. Second, if `decodeURIComponent()` encounters a bare `%` symbol that is not followed by two valid hexadecimal digits (like `50% off`) or an incomplete multi-byte UTF-8 sequence, the tool catches the `URIError: URI malformed` exception and displays a clear error message until the invalid `%` sequence is fixed.

विस्तृत गाइड एवं तकनीकी जानकारी

इंटरनेट पर किसी भी वेब यूआरएल (URL - RFC 3986 मानक) को सुरक्षित रूप से भेजने के लिए केवल सीमित ASCII अक्षरों की ही अनुमति होती है। जब किसी यूआरएल या सर्च पैरामीटर में खाली जगह (Spaces), गैर-अंग्रेजी यूनिकोड अक्षर (जैसे हिंदी देवनागरी शब्द या इमोजी), या आरक्षित चिन्ह (`?`, `&`, `=`, `#`, `/`, `:`) आते हैं, तो उन्हें 'परसेंट-एनकोडिंग' (Percent-Encoding) में बदलना आवश्यक होता है—जिसमें प्रत्येक UTF-8 बाइट को `%` और दो हेक्साडेसिमल अंकों के रूप में लिखा जाता है (जैसे स्पेस `%20` बन जाता है और `&` का चिन्ह `%26` बन जाता है)। हमारा URL Encoder & Decoder आपके टाइप करते ही रियल-टाइम में काम करता है और एक ही स्क्रीन पर `Encoded (RFC 3986)` तथा `Decoded` दोनों परिणाम तुरंत दिखाता है।

तकनीकी रूप से यह टूल ब्राउज़र के मानक `encodeURIComponent()` और `decodeURIComponent()` फंक्शन का उपयोग करता है। डेवलपर्स के लिए यह समझना बहुत उपयोगी है कि `encodeURIComponent()` सामान्य `encodeURI()` से अलग कैसे काम करता है: जहाँ `encodeURI()` पूरे यूआरएल की संरचना बनाए रखने के लिए `:`, `/`, `?` और `&` को एनकोड नहीं करता, वहीं `encodeURIComponent()` सभी आरक्षित चिन्हों को भी एनकोड कर देता है (`:` को `%3A`, `/` को `%2F`, `?` को `%3F` और `=` को `%3D` में बदल देता है) और केवल सामान्य अक्षरों (`A–Z`, `a–z`, `0–9`, `-`, `_`, `.`, `!`, `~`, `*`, `'`, `(`, `)`) को ही बिना बदले छोड़ता है। इसलिए जब आपको किसी क्वेरी पैरामीटर के अंदर कोई वैल्यू या पूरा रीडायरेक्ट यूआरएल (`?redirect=...`) सुरक्षित रूप से भेजना हो, तो `encodeURIComponent()` सबसे सटीक तरीका है।

यूआरएल एनकोडिंग और डिकोडिंग के दौरान दो आम गलतियों से बचना चाहिए। पहली बात, यदि आप किसी पूरे यूआरएल (`https://example.com/search?q=test`) को एनकोड करके मिले परिणाम (`https%3A%2F%2F...`) को सीधे किसी वेबसाइट के `<a href="...">` लिंक में डाल देंगे, तो वह लिंक काम नहीं करेगा क्योंकि `https://` के कोलन और स्लैश भी एनकोड हो चुके होते हैं; पूरे यूआरएल को तभी एनकोड करें जब उसे किसी दूसरे यूआरएल के पैरामीटर के अंदर भेजना हो। दूसरी बात, यदि इनपुट टेक्स्ट में कोई ऐसा अकेला `%` चिन्ह मौजूद हो जिसके बाद दो वैध हेक्साडेसिमल अंक न हों (जैसे `100% free`), या कोई अधूरा UTF-8 कोड हो, तो डिकोड करते समय `Malformed URL: URIError` संदेश दिखाई देगा जिसे सही `%25` लिखकर ठीक किया जा सकता है।

Frequently Asked Questions (FAQs)

Q: Why does this tool encode colons (`:`) and slashes (`/`) into `%3A` and `%2F`?
This tool uses `encodeURIComponent()`, which encodes all reserved URL delimiters (`:`, `/`, `?`, `&`, `=`) so that a complete URL or arbitrary string can be safely passed inside a single query parameter (for example, `?redirect=https%3A%2F%2Fexample.com`) without breaking the outer URL structure.
प्रश्न: यह टूल यूआरएल के कोलन (`:`) और स्लैश (`/`) को भी `%3A` और `%2F` में क्यों बदल देता है?
यह टूल `encodeURIComponent()` का उपयोग करता है जो `:`, `/`, `?`, `&` और `=` जैसे सभी आरक्षित चिन्हों को एनकोड कर देता है, ताकि किसी पूरे यूआरएल या टेक्स्ट को किसी दूसरे यूआरएल के क्वेरी पैरामीटर (जैसे `?redirect=https%3A%2F%2F...`) के अंदर सुरक्षित रूप से भेजा जा सके।
Q: Why do I see a 'Malformed URL: URIError: URI malformed' error message?
JavaScript's `decodeURIComponent()` throws a `URIError` whenever your input contains a literal `%` sign not followed by two valid hexadecimal characters (such as `50% discount`), or when a multi-byte UTF-8 percent sequence (like `%E0%A4`) has been cut off mid-character.
प्रश्न: मुझे 'Malformed URL: URIError: URI malformed' एरर संदेश क्यों दिखाई दे रहा है?
जब आपके इनपुट टेक्स्ट में कोई ऐसा `%` चिन्ह होता है जिसके ठीक बाद दो वैध हेक्साडेसिमल अंक नहीं होते (जैसे `50% discount`), या जब किसी हिंदी/यूनिकोड अक्षर का परसेंट-कोड अधूरा कट गया हो, तब `decodeURIComponent()` यह `URIError` दिखाता है।
Q: What is the difference between `%20` and `+` for spaces in URLs?
Under RFC 3986 (used by `encodeURIComponent`), spaces are encoded as `%20`. The `+` sign for spaces comes from the older HTML form encoding specification (`application/x-www-form-urlencoded`). Because `decodeURIComponent()` follows RFC 3986 strictly, it decodes `%20` as a space and leaves `+` as a literal plus sign.
प्रश्न: यूआरएल में स्पेस (Space) के लिए `%20` और `+` में क्या अंतर है?
RFC 3986 मानक (जिसका उपयोग `encodeURIComponent` करता है) के अनुसार खाली जगह (Space) को `%20` के रूप में एनकोड किया जाता है। स्पेस के लिए `+` चिन्ह पुराने HTML फॉर्म सबमिशन (`application/x-www-form-urlencoded`) में प्रयोग होता है। इसलिए `decodeURIComponent()` केवल `%20` को स्पेस में बदलता है और `+` को जस का तस रखता है।
Q: Does this tool support encoding Hindi (Devanagari) words and emojis?
Yes. Every Hindi character or emoji is first converted into its UTF-8 byte sequence, and each byte is percent-encoded (for example, `नमस्ते` is encoded into 18 UTF-8 hex byte triplets) and decoded back losslessly.
प्रश्न: क्या यह टूल हिंदी (देवनागरी) शब्दों और इमोजी को भी एनकोड और डिकोड कर सकता है?
हाँ। यह टूल हिंदी अक्षरों और इमोजी को पहले उनके UTF-8 बाइट्स में बदलता है और फिर प्रत्येक बाइट को परसेंट-एनकोड करता है, जिसे डिकोड करने पर वापस मूल हिंदी शब्द बिल्कुल सही रूप में मिल जाता है।
Q: Is my URL or query token sent to any server during encoding or decoding?
No. All URL encoding and decoding runs 100% locally inside your web browser using JavaScript, so private callback URLs, query strings, and parameters never leave your device.
प्रश्न: क्या एनकोडिंग या डिकोडिंग के दौरान मेरा यूआरएल या डेटा किसी सर्वर पर भेजा जाता है?
नहीं। यूआरएल एनकोडिंग और डिकोडिंग की पूरी प्रक्रिया आपके वेब ब्राउज़र के अंदर ही जावास्क्रिप्ट द्वारा स्थानीय रूप से होती है, इसलिए आपका कोई भी डेटा किसी बाहरी सर्वर पर नहीं जाता।

Related Free Tools