Sadhuji

URL Encode / Decode

Percent-encode and decode URL components to ensure safe transmission of special characters in query strings, paths, and fragments.

How to Use

  1. 1

    Paste the text or URL you want to encode or decode into the input field.

  2. 2

    Choose the encoding mode: 'Component' for query parameter values or 'Full URI' for complete URLs.

  3. 3

    Click 'Encode' or 'Decode' to perform the conversion.

  4. 4

    Review the character breakdown panel to see how each character is represented.

  5. 5

    Copy the result to your clipboard for use in your code or browser.

Frequently Asked Questions

About URL Encode / Decode

What is URL Encode / Decode?

The URL Encode / Decode tool converts text to and from percent-encoded format as defined by RFC 3986. In a URL, certain characters — including spaces, ampersands, question marks, slashes, and non-ASCII characters — must be represented as percent-encoded byte sequences (e.g., a space becomes %20 or +). This tool handles both full URL encoding and component-level encoding, mirroring the behavior of JavaScript's encodeURI() and encodeURIComponent() functions. Whether you are constructing API query strings, building OAuth signature base strings, or debugging redirect URLs that contain nested encoded parameters, this tool provides an accurate and instant conversion.

Why Use URL Encode / Decode?

Incorrectly encoded URLs are one of the most common sources of bugs in web development. A missing percent-encode on an ampersand in a query parameter can split a single value into two parameters. A double-encoded space (%2520 instead of %20) can cause 404 errors or broken redirects. Manually encoding characters is tedious and error-prone, especially when dealing with multibyte UTF-8 characters like emojis or CJK text. This tool lets you paste any text, see the correctly encoded result instantly, and switch between full-URL and component-level encoding modes so you always get the right output for your use case.

How to Use

Paste the text you want to encode into the input area and select the encoding mode: 'Component' (equivalent to encodeURIComponent — encodes everything except A–Z, a–z, 0–9, and -_.~) or 'Full URI' (equivalent to encodeURI — preserves structural characters like :, /, ?, and #). Click 'Encode' to see the result. For decoding, paste a percent-encoded string and click 'Decode' to reveal the original text. The tool also provides a breakdown panel that shows each character alongside its encoded representation, making it easy to learn which characters require encoding.

Example Usage

You are building an API call that includes a user's search query in the URL: https://api.example.com/search?q=hello world&lang=en. The space in 'hello world' and the ampersand separating parameters must be handled properly. Paste 'hello world' into the component encoder to get 'hello%20world'. If you accidentally encode the entire URL, the tool preserves the scheme and delimiters so you get https://api.example.com/search?q=hello%20world&lang=en instead of encoding the colons and slashes. For debugging, paste a doubly encoded string like 'hello%2520world' and decode it twice to trace the encoding chain.

Benefits

Two encoding modes (component and full URI) match the most common JavaScript encoding functions, reducing confusion. Real-time encoding as you type provides instant feedback. The character breakdown panel is a learning tool that helps developers understand exactly which characters need encoding and why. Full UTF-8 support means emojis, accented letters, and CJK characters are encoded correctly. Everything runs in your browser with no server dependency.

Related Tools