Encode and decode URL strings for safe query parameters, path segments, and web debugging.
Last updated: February 23, 2026
encodeURIComponent encodes all special characters including : / ? # & = and is used for encoding individual query parameters or path segments.
Paste a full URL to break it down into its components.
URL encoding, also known as percent encoding, is the mechanism for encoding information in a Uniform Resource Identifier (URI). URLs can only be sent over the Internet using the ASCII character set, so characters outside this range must be converted into a valid ASCII format. URL encoding replaces unsafe or reserved characters with a percent sign (%) followed by two hexadecimal digits representing the character's ASCII code. For example, a space becomes %20, and an ampersand becomes %26.
JavaScript provides two built-in functions for URL encoding, and understanding the difference between them is critical for web developers. encodeURI() is designed to encode a complete URI. It preserves characters that have special meaning in a URL structure, such as :, /, ?, #, &, and =. Use encodeURI() when you have a full URL and want to ensure that non-ASCII characters (like spaces in path segments) are properly encoded without breaking the URL structure.
encodeURIComponent(), on the other hand, encodes everything except letters, digits, and a few special characters (- _ . ! ~ * ' ( )). This means it will encode /, ?, &, =, and other URL-significant characters. Use encodeURIComponent() when encoding individual query parameter values, path segments, or any string that will be inserted into a URL. Using encodeURI() for a query parameter value that contains & would leave the ampersand unencoded, potentially splitting it into two parameters.
The most frequently encoded characters in URLs include: space (%20 or + in query strings), exclamation mark (%21), hash (%23), dollar sign (%24), ampersand (%26), single quote (%27), plus sign (%2B), comma (%2C), forward slash (%2F), colon (%3A), semicolon (%3B), equals (%3D), question mark (%3F), at sign (%40), and square brackets (%5B and %5D). Non-ASCII characters like accented letters are first encoded as UTF-8 bytes and then percent-encoded.
A complete URL consists of several parts: the scheme (protocol) such as https, followed by ://, then the host (domain name or IP address), an optional port number preceded by a colon, the path to the resource, an optional query string starting with ? containing key-value pairs separated by &, and an optional fragment identifier starting with #. Each of these components has different rules about which characters must be encoded.
Proper URL encoding is essential for web security. Failing to encode user-supplied data in URLs can lead to injection attacks, broken redirects, and data corruption. When constructing URLs dynamically in your application, always use encodeURIComponent() for query parameter values to prevent special characters from being interpreted as URL delimiters. Modern web frameworks typically handle URL encoding automatically, but understanding the underlying mechanism helps developers debug issues with encoded characters, especially when working with APIs, webhooks, or third-party integrations that may double-encode or fail to decode parameters correctly.
Encode and decode URL strings for safe query parameters, path segments, and web debugging. This tool runs in-browser for fast results without account setup.
Yes. URL Encoder/Decoder is free to use on ConvertCrunch.
Results depend on the inputs and assumptions you provide. Always validate final numbers or outputs against your official workflow before publishing or filing.
ConvertCrunch tools are built for immediate use with no signup required.
This tool is part of larger workflows. Open a hub to continue with the next relevant tools.
Continue your workflow with these tools from the same playbook.
PDF Merger
Merge multiple PDFs into a single document.. Free online, browser-based tool with instant results and no signup.
PDF to Word Converter
Convert PDF documents to editable Word format.. Free online, browser-based tool with instant results and no signup.
JSON to CSV / CSV to JSON Converter
Convert between JSON and CSV formats instantly. Supports custom delimiters, nested objects, and file upload.
ZIP Compressor
Compress files into ZIP archives.. Free online, browser-based tool with instant results and no signup.
cURL Command Generator
Build cURL commands with headers, auth, query params, and body payloads for reliable API testing.
HTML Entity Encoder/Decoder
Encode special characters to HTML entities or decode entities back to readable text.
JWT Decoder
Decode JWT headers and payloads, inspect claims, and quickly check token expiry timestamps.
AI Output Evaluator
Score model responses for relevance, structure quality, and risk signals to quickly diagnose weak output patterns.
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 strings instantly. Supports UTF-8 and file encoding.
Chmod Calculator
Calculate Unix file permissions with an interactive checkbox matrix. Convert between octal and symbolic notation.
Color Converter
Convert colors between HEX, RGB, HSL, and CMYK formats. Includes a color picker and palette generator.
Cron Expression Parser
Validate cron syntax and preview upcoming run times in UTC to debug schedules before deployment.
Next Step
Continue with PDF Merger