URL Encoder / Decoder

Encode and decode URLs instantly using percent-encoding. Parse any URL into its components, build query strings from key-value pairs, detect double encoding, and bulk process multiple lines -- all client-side in your browser.

Paste a URL above to break it into its components.
Add parameters above to build a query string

How It Works

🔒

Encode & Decode

Convert text to percent-encoded format using encodeURIComponent or encodeURI. Decode any percent-encoded string back to readable text. Handles Unicode, special characters, and reserved URL characters.

🔍

URL Parser

Paste any URL and instantly see it broken down into protocol, host, port, path, query parameters, and fragment. Each component is displayed separately with one-click copy buttons.

🔧

Query Builder

Build query strings visually by adding key-value pairs. Values are automatically encoded with encodeURIComponent. Copy the result and append it to any URL.

Double-Encoding Detection

Automatically detects when input or output contains double-encoded patterns (like %2520 instead of %20) and warns you before they cause hard-to-debug issues in your application.

Understanding URL Encoding

URL encoding, also known as percent-encoding, is defined in RFC 3986 as the mechanism for encoding characters in a Uniform Resource Identifier (URI) that are not allowed or have special meaning. When a character needs to be encoded, it is replaced with a percent sign (%) followed by two hexadecimal digits representing the character's byte value in UTF-8.

Why URL Encoding Matters

URLs can only contain a limited set of characters from the ASCII character set. Characters outside this set -- including spaces, non-ASCII characters like accented letters, and reserved characters used outside their intended purpose -- must be percent-encoded to be included in a URL. Incorrect encoding is one of the most common causes of broken links, failed API calls, and security vulnerabilities like open redirect attacks.

encodeURI vs encodeURIComponent

JavaScript provides two built-in functions for URL encoding:

Common Characters and Their Encodings

Character    Encoded
Space        %20 (or + in form data)
!            %21
#            %23
$            %24
&            %26
'            %27
+            %2B
/            %2F
=            %3D
@            %40

How to Use This Tool

In the Encode / Decode tab, paste text or a URL and click Encode or Decode. Check the "Use encodeURI" box to preserve URL structure characters. For multiple strings, enter one per line for bulk processing. The URL Parser tab breaks any URL into its protocol, host, port, path, query parameters, and hash. The Query Builder tab lets you add key-value pairs to construct a properly-encoded query string.

Common Use Cases

Frequently Asked Questions

What is URL encoding (percent-encoding)?
URL encoding, also known as percent-encoding, is a method for encoding characters in a URL that are not permitted in the standard URL character set or that have special meaning. Each character is replaced with a percent sign (%) followed by two hexadecimal digits representing the character's byte value in UTF-8 encoding. For example, a space character becomes %20, an ampersand (&) becomes %26, and a forward slash (/) becomes %2F. This encoding is defined in RFC 3986 and is essential for transmitting data in URLs reliably across the internet.
What is the difference between encodeURI and encodeURIComponent?
encodeURI is designed to encode a complete URI and therefore preserves characters that have special meaning in URLs, including colons (:), forward slashes (/), question marks (?), hash signs (#), ampersands (&), and equals signs (=). encodeURIComponent encodes all characters except unreserved characters (letters, digits, hyphens, underscores, periods, tildes, and a few others), making it suitable for encoding individual components like query parameter values. In practice, use encodeURIComponent when encoding parameter values, and encodeURI when you have a full URL with unencoded non-ASCII characters but valid structure.
What is double encoding and why is it a problem?
Double encoding occurs when an already percent-encoded string is encoded again. For example, the space character encodes to %20. If you encode %20 again, the percent sign (%) becomes %25, turning the whole thing into %2520. This is a common bug in web applications where encoding is applied more than once in the processing pipeline -- for instance, once in client-side JavaScript and again by the HTTP library or server framework. Double-encoded URLs often cause 404 errors, broken links, or incorrect data being passed to APIs. This tool detects patterns like %25XX in your input and output and warns you when double encoding is likely.
Which characters need to be URL encoded?
Characters that must be percent-encoded in URLs include: spaces (encoded as %20 or + in form data), all non-ASCII characters (accented letters, CJK characters, emoji, etc.), and reserved characters when used outside their designated purpose. The reserved characters are : / ? # [ ] @ ! $ & ' ( ) * + , ; =. The percent sign (%) itself must be encoded as %25 when used literally. Unreserved characters that never need encoding are: uppercase and lowercase letters (A-Z, a-z), digits (0-9), hyphen (-), period (.), underscore (_), and tilde (~).
What is the difference between %20 and + for spaces?
Both %20 and + can represent a space character, but they come from different encoding standards. The %20 encoding comes from RFC 3986 (URI specification) and is the standard percent-encoding for a space. The + encoding comes from the application/x-www-form-urlencoded format used in HTML form submissions, as defined in the HTML specification. In query strings submitted from HTML forms, spaces are encoded as +, while in all other parts of a URL (path, fragment, etc.), spaces must be encoded as %20. Modern best practice is to use %20, which works everywhere. JavaScript's encodeURIComponent produces %20, while URLSearchParams produces + for form-compatible encoding.
Is it safe to paste my URLs into this tool?
Yes, this tool is completely safe. All encoding, decoding, and URL parsing happens entirely in your browser using JavaScript's built-in encodeURIComponent, decodeURIComponent, and URL APIs. No data is sent to any server, no data is stored, and no data is logged. Your URLs and text never leave your browser. You can verify this by checking the network tab in your browser's developer tools -- there are no API calls made when you use this tool.
Can I encode or decode multiple strings at once?
Yes, this tool supports bulk encoding and decoding. Simply enter multiple strings in the input area, one per line, and click Encode or Decode. Each line will be processed independently and the results will appear in the output area, also one per line, preserving the same order. This is useful when you need to encode a list of parameter values, decode multiple URLs from a log file, or process a batch of strings for API testing.

Explore More Developer Tools

Check out our other free developer tools. Format JSON, decode JWTs, parse cron expressions, and more -- all from your browser with no sign-up required.

JSON Formatter →