URL Encoder / Decoder

Encode or decode URLs using encodeURI or encodeURIComponent. 100% client-side.

Last reviewed: April 2026

New to this tool? Click here for instructions

Input
Output
Paste a URL or text above to encode or decode it.

Quick Answer

URL encoding (percent-encoding) replaces characters that aren't safe in a URL with a % followed by their hex code โ€” a space becomes %20 and an ampersand becomes %26. This tool encodes text for safe use in query strings and decodes percent-encoded URLs back to readable text. Paste your text above; everything runs in your browser.

How to Use the URL Encoder / Decoder

To use the URL Encoder / Decoder, follow these steps:

1. Paste your URL or text into the input area on the left.

2. Choose a mode - Encode (encodeURI), Decode (decodeURI), Encode Component, or Decode Component.

3. View the result - the encoded or decoded output appears instantly on the right.

4. Copy or download - use the buttons to copy the output or save it as a text file.

When to Use the Tool in Real Workflows

Use the URL Encoder / Decoder in the following scenarios:

1. Query parameters - when appending values to a URL that contain spaces, ampersands, or other special characters.

2. Form submissions - when sending data via GET requests or manually encoding values in JavaScript API requests.

3. Redirect URLs - when including a full URL as a query parameter.

4. Non-ASCII characters - when URLs contain accented characters, emoji, or CJK characters.

How It Works

The URL Encoder / Decoder tool works by using JavaScript's built-in functions `encodeURI` and `encodeURIComponent` to encode and decode URLs.

These functions replace special characters with a percent sign (%) followed by two hexadecimal digits representing the character's ASCII code.

This ensures that URLs are transmitted correctly across all browsers and servers.

Tips, Edge Cases, or Limitations

1. Double Encoding: Be cautious of double-encoding. Running `encodeURIComponent` on a string that is already encoded can cause errors. Always check if your string is already encoded before encoding it again.

2. Security: Proper URL encoding is crucial for security. Failing to encode user-supplied values before embedding them in URLs can open your application to injection attacks.

3. Browser Compatibility: The tool is 100% client-side, meaning it runs entirely in your browser without sending any data to a server. This ensures privacy and security.

4. Limitations: The tool supports only the `encodeURI` and `encodeURIComponent` methods. For more complex encoding needs, consider using a dedicated URL encoding library.

Frequently Asked Questions

URL encoding, also called percent-encoding, is a mechanism for representing special characters in a URL by replacing them with a percent sign (%) followed by two hexadecimal digits representing the character's ASCII code.
`encodeURI` encodes a complete URL, leaving structural characters like /, ?, =, &, #, and : intact. `encodeURIComponent` encodes everything that `encodeURI` encodes, plus the structural characters.
Use `encodeURIComponent` when encoding individual query parameter names and values, as it encodes everything that `encodeURI` encodes, plus the structural characters.
No, the URL Encoder / Decoder is 100% client-side. Your data is processed entirely in your browser without sending any data to a server.
All characters outside the allowed set of printable ASCII characters, including spaces, non-ASCII Unicode characters, and certain punctuation, are encoded by `encodeURIComponent`.

Quick reference

URL Encoder / Decoder โ€” quick reference
AspectDetail
PurposeURL Encoder / Decoder is a free browser tool for fast, repeatable tasks.
Runs inAny modern browser โ€” no install, no signup.
PrivacyData is processed locally in your browser; no upload to any server.
Best forQuick lookups, daily reference, learning, prototyping.