URL Encoder Decoder
Encode and decode URLs instantly. Convert special characters into percent-encoded, URL-safe formats or parse encoded strings back into human-readable text.
URL percent-encoding transforms non-ASCII characters and reserved delimiter symbols (`&`, `=`, `?`, `/`, `#`, spaces) into standardized UTF-8 hexadecimal triplets (`%XX`) under RFC 3986, ensuring query parameters and URI components transmit reliably across web servers without breaking HTTP request routing.
IETF RFC 3986 Uniform Resource Identifier (URI) Standards
Percent-Encoding Formula: `%` + 2 Hex DigitsUnreserved characters (`A-Z`, `a-z`, `0-9`, `-`, `_`, `.`, `~`) are never encoded. `encodeURIComponent()` safely encodes all delimiters within parameter values, while `encodeURI()` preserves full URL protocol separators (`http://`, `?`, `/`, `&`).
Compare Similar Calculators
JSON Formatter
Fix, format, beautify, validate, and minify JSON data instantly with one click. Free online JSON Formatter and JSON Beautifier for developers.
ViewUUID Generator
Generate UUID v4 identifiers instantly. Create single or multiple unique UUIDs for development, databases, APIs, testing, and distributed architecture.
ViewBase64 Encoder Decoder
Encode text or binary data to Base64 strings and decode Base64 back to its original format instantly. Free, secure, client-side online developer utility.
ViewConstruction Calculators
Other Calculators
How the URL Encoder Decoder Works
Follow these simple steps to get accurate results instantly.
Enter URL or Text
Type or paste your raw URL string, key-value query parameters, or percent-encoded content into the input field.
Select Operation
Choose the appropriate action: 'Encode' to secure special characters or 'Decode' to translate them back to plain text.
View Processed Output
The browser instantly handles the string conversion and populates the results terminal without any page reload.
Copy Result
Instantly extract your formatted URL component or plain text stream directly onto your system clipboard with a single click.
URL Percent-Encoding Mechanics
encodeURIComponent(text) or encodeURI(text)
URL encoding (also known as percent-encoding) translates reserved, unsafe, or non-ASCII characters within a Uniform Resource Identifier into a triplet sequence consisting of the percentage character '%' followed by a two-digit hexadecimal representation of the character's UTF-8 byte value.
Example Calculation
Input: https://example.com/search?q=hello world
Output: https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world
Common Uses
- • Sanitizing API query parameters
- • Escaping nested callback redirect URLs
- • Handling spaces and non-ASCII glyphs in slugs
- • Formatting form-urlencoded POST requests
- • Preventing XSS injections via malicious path variables
Frequently Asked Questions
Verified answers to essential calculation and diagnostic questions.
URL encoding, officially designated as percent-encoding under the global RFC 3986 standard, is a data conversion process that maps characters into a safe, reliable format for transmission via the HTTP protocol. Within a standard URL structure, specific characters possess pre-defined, structural functional meanings—such as the forward slash (`/`) separating routing paths, the question mark (`?`) initializing query parameters, and the ampersand (`&`) partitioning distinct key-value pairs. If an asset payload or search string contains these characters naturally (for instance, a product name like 'Toys & Games'), the server's routing middleware will parse them incorrectly, corrupting the query. Percent-encoding replaces these reserved or invalid characters with a specialized triplet sequence consisting of a `%` sign followed by a two-digit hexadecimal byte value.
The standard Uniform Resource Identifier specification explicitly classifies empty spaces as unsafe characters because they act as delimiters inside legacy terminal configurations and transport layers. To resolve this, spaces must be explicitly escaped. The string sequence `%20` represents the precise hexadecimal representation of a standard space character within the ASCII table (decimal value 32 maps to hex 20). Alternatively, you may observe spaces turning into a plus sign (`+`) when processing HTML form elements configured with the `application/x-www-form-urlencoded` MIME layout. While the plus variant is standard for legacy query block data payloads, modern web applications rely predominantly on `%20` to guarantee cross-compatible processing.
The fundamental difference lies in which characters the functions are allowed to escape. The generic `encodeURI()` function is designed to serialize an entire, fully formed URL path; because of this, it leaves essential routing markers like `http://`, `https://`, domain names, port paths, and query tags completely untouched. Conversely, `encodeURIComponent()` assumes it is dealing with an isolated query value string. It aggressively converts every non-alphanumeric character it encounters—including slashes, colons, dots, and question marks. If you pass a full URL through `encodeURIComponent()`, the entire structure breaks into an un-routable flat string block, which is the exact behavior required when nesting a callback link inside a query string parameter.
No, URL encoding does not offer any form of cryptographic data security, masking, or access isolation. It functions purely as a text translation layer designed to preserve layout structure during transit. Anyone can read, intercept, or instantly reverse a percent-encoded URL back into its original plain text format using any browser developer console or online parsing engine. You should never include raw account tokens, user passwords, private encryption salts, or sensitive personal data directly inside an open URL string block, regardless of whether it is encoded.
No data is ever stored, logged, or shared. This tool executes its text transformation logic natively within the JavaScript runtime container hosted directly inside your web browser. No network payloads containing your string buffers are transmitted across the internet to external cloud storage structures, databases, or tracking scripts. This localized processing ensures total privacy, making the interface completely safe for engineering pipelines, sensitive system parameters, and active configuration workflows.
The internet standard RFC 3986 splits all characters into two explicit categories. Unreserved characters are safe to include inside any URL sequence without undergoing conversion; this category consists of uppercase and lowercase letters (`A-Z`, `a-z`), numbers (`0-9`), hyphens (`-`), underscores (`_`), periods (`.`), and tildes (`~`). Reserved characters are symbols that serve specific structural purposes inside network addresses. This group includes characters like `:`, `/`, `?`, `#`, `[`, `]`, `@`, `!`, `$`, `&`, `'`, `(`, `)`, `*`, `+`, `,`, `;`, and `=`. Whenever these reserved symbols appear as actual text within a data parameter rather than acting as a routing separator, they must be converted into their safe percent-encoded equivalent.
The Developer's Technical Guide to URL Encoding and String Serialization
The underlying architecture of the modern web relies entirely on the successful routing of data via Uniform Resource Locators (URLs). However, because network transport components conform to rigid text protocols, passing raw text strings, complex non-ASCII charsets, or special mathematical characters can cause routing errors.
The URL encoding protocol solves this problem. It converts unsafe character sets into a stable, ASCII-compliant format known as percent-encoding. This ensures that browsers, reverse proxies, content delivery networks (CDNs), and downstream API gateways can parse and route your query strings without experiencing formatting issues or data loss.
---Deep Dive: The Percent-Encoding Look-Up Index
When a web browser encounters an un-escaped symbol during an API fetch operation, it translates the asset into a specific byte triplet layout. The index table below maps common problematic symbols to their standard, RFC 3986-compliant percent-encoded equivalents:
| Literal Symbol | Hexadecimal Mapping (UTF-8) | Percent-Encoded Output | Standard Routing Functionality / Structural Meaning |
|---|---|---|---|
Space |
0x20 |
%20 |
Unsafe character. Often splits commands inside legacy terminal environments. |
/ |
0x2F |
%2F |
Path segment separator. Delimits structural routing levels. |
? |
0x3F |
%3F |
Query string indicator. Separates path scopes from parameters. |
& |
0x26 |
%26 |
Parameter delimiter. Groups independent key-value tokens together. |
= |
0x3D |
%3D |
Key-value assignment operator. Binds a parameter label to its input value. |
# |
0x23 |
%23 |
Anchor or fragment identifier. Targets specific UI anchors within a document. |
: |
0x3A |
%3A |
Protocol separator (e.g., following https) or port identifier. |
% |
0x25 |
%25 |
Escape flag. Acts as the literal indicator for percent-encoding itself. |
Encoding vs. Encryption: Understanding Data Formats
A common security pitfall among junior developers is treating URL encoding as a security layer. This assumption can introduce significant cross-site scripting (XSS) vectors or lead to sensitive data exposure. The table below outlines the core differences between these data formats:
| Feature Metric | URL Percent Encoding | Standard Cryptographic Encryption |
|---|---|---|
| Core Focus | Ensures data syntax compatibility and routing stability across HTTP streams. | Ensures data confidentiality by restricting access to authorized keys. |
| Algorithmic Complexity | Low. Performs a simple lookup substitution based on ASCII tables. | High. Uses advanced mathematics (e.g., AES-256 or RSA bitwise shifting). |
| Access Restrictions | Open standard. Anyone can reverse it instantly without specialized keys. | Highly secure. Requires the matching secret key or decryption token. |
| Data Transformation | Converts special characters into strings like %20 or %3F. |
Scrambles readable data into completely random cipher text blocks. |
The Critical Importance of URL Escaping in Modern Software Engineering
1. Deeply Nested Callbacks and Redirect Links
When building multi-platform workflows (such as OAuth login pages or single sign-on enterprise systems), users are frequently routed away to a third-party domain. Once authenticated, the system needs a redirect path to return them to their original location. This target link is passed as a query string parameter, styled like this:
https://auth.provider.com/login?clientId=9821&redirectTo=https://my-app.com/dashboard?tab=billing
Without proper encoding, the server's routing engine gets confused: it struggles to tell if the second ?tab=billing parameter belongs to your application or the authentication provider. If you instead process the return parameter through encodeURIComponent(), the structure remains clean, organized, and free of routing conflicts:
https://auth.provider.com/login?clientId=9821&redirectTo=https%3A%2F%2Fmy-app.com%2Fdashboard%3Ftab%3Dbilling---
Native Code Implementations Across Core Programming Ecosystems
If you need to move beyond manual conversions using our interactive tool and integrate automated processing directly into your source code, modern development frameworks provide native support:
JavaScript ES6 / TypeScript Environment
const queryParam = "Shoes & Apparel - Premium Edition"; // Encode an individual parameter value safely const safeParam = encodeURIComponent(queryParam); console.log(safeParam); // Output: Shoes%20%26%20Apparel%20-%20Premium%20Edition // Decode the parameter value back to plain text const baseText = decodeURIComponent(safeParam); console.log(baseText); // Output: Shoes & Apparel - Premium Edition
Python 3 Standard Library
from urllib.parse import quote, unquote target_string = "search_item=electronics/phones+cases" # Execute a standard percent-encoding routine escaped_output = quote(target_string) print(escaped_output) # Output: search_item%3Delectronics/phones%2Bcases # Execute a reverse recovery decoding routine original_input = unquote(escaped_output) print(original_input)
Go (Golang) Core Packages
package main
import (
"fmt"
"net/url"
)
func main() {
rawPath := "user/profile?status=active & verification=true"
// Native programmatic URL Query escape routine
encodedString := url.QueryEscape(rawPath)
fmt.Println("Encoded Payload:", encodedString)
// Reverse programmatic URL query unescape routine
decodedString, _ := url.QueryUnescape(encodedString)
fmt.Println("Decoded String:", decodedString)
}
Written & maintained by Aditya Singh
Aditya Singh is a software engineer and the founder of DevCalc, based in Uttar Pradesh, India. He builds and maintains every tool on this site with careful attention to accuracy and user experience. Read more about the author →
