URL Encoder / Decoder
Encode special characters in URLs, or decode percent-encoded URL strings back to plain text.
What This Tool Does
Encodes and decodes URLs and query strings in your browser using percent-encoding (RFC 3986). Handles full URLs, individual parameters, and special characters correctly.
Who This Is For
- Backend developers constructing API request URLs with special characters or non-ASCII input
- Frontend engineers debugging query string parameters that are being double-encoded
- Anyone building a URL that includes spaces, ampersands, or international characters
- QA engineers testing URL handling edge cases in web applications
Example: Input: A URL with spaces and special characters like https://example.com/search?q=hello world & more → Output: Encoded: https://example.com/search?q=hello%20world%20%26%20more β safe for any HTTP request
π‘ URL encoding is often needed when constructing API requests that also contain JSON payloads. Use the JSON Formatter to validate the request body before encoding, and the Base64 Encoder for encoding binary data in query parameters.
How to Encode and Decode URLs
Paste a URL, query string, or any text into the input field and click Encode or Decode. The result appears immediately in the output panel, ready to copy.
- Paste your URL or string into the input field
- Click "Encode" to convert special characters to percent-encoding
- Click "Decode" to convert percent-encoded text back to readable form
- Copy the result with one click
What Is URL Encoding (Percent Encoding)?
URL encoding (formally called percent-encoding) converts characters that are not allowed in URLs into a safe format. The format is a percent sign followed by two hexadecimal digits representing the character's ASCII code.
| Character | Encoded | Where it appears |
|---|---|---|
| Space | %20 (or +) | Query strings, form data |
| & | %26 | Within parameter values |
| = | %3D | Within parameter values |
| ? | %3F | Within parameter values |
| / | %2F | Path segments with slashes in values |
| # | %23 | Fragment identifiers in values |
| + | %2B | When literal + is needed, not space |
| @ | %40 | Email addresses in URLs |
When to Encode a Full URL vs Just a Parameter Value
This is a critical distinction many developers get wrong:
- Encode parameter values only β when building a URL, encode the values within query parameters, not the entire URL. Encoding the full URL will encode the &, =, and ? characters that are structural parts of the URL.
- encodeURI() vs encodeURIComponent() β in JavaScript,
encodeURI()encodes a full URL (preserves structure characters like /, ?, &, =), whileencodeURIComponent()encodes a single value (encodes those characters too). UseencodeURIComponent()for parameter values. - Form submission β HTML forms URL-encode their values automatically when submitted. You should encode manually only when constructing URLs in code.
- API calls β when passing user-entered text as query parameters in API calls, always encode the values to prevent injection and malformed requests.
Common URL Encoding Use Cases
- Search queries β search engine URLs encode the query string. "how to bake bread" becomes "how+to+bake+bread" or "how%20to%20bake%20bread" in a URL.
- Passing URLs as parameters β when a URL itself is a query parameter value (like a redirect URL), the inner URL must be fully encoded.
- International characters β URLs containing non-ASCII characters (ΓΌ, Γ©, δΈ) must be percent-encoded. Browsers display them decoded in the address bar, but the actual HTTP request uses encoded form.
- OAuth and authentication β OAuth redirect URIs. Use our JWT decoder to inspect OAuth tokens after authentication. Use our JWT decoder to inspect OAuth tokens after authentication and state parameters must be properly encoded to prevent security vulnerabilities.
- Data URIs β embedding data in URLs (like base64-encoded images) requires careful encoding of the content-type prefix.
URL and Web Encoding Tools
URL encoding is part of a web development and API workflow:
- Encode in Base64 β used for binary data and authentication credentials
- Test URL patterns with regex β validate URL format before encoding
- Format JSON payloads that you are encoding as URL parameters
- Decode JWT tokens used in OAuth redirect flows
Frequently Asked Questions
How It Works
When to Use This Tool
- βEncoding a URL that contains spaces, ampersands, or special characters before using it in a query string
- βDebugging a URL that's being incorrectly encoded or double-encoded
- βBuilding API request URLs that include JSON or structured data in query parameters
- βDecoding a URL-encoded string from a server log or error message to see the original value
π Privacy & Security
URL encoding and decoding uses JavaScript's built-in encodeURIComponent() and decodeURIComponent() functions β no data leaves your browser. Safe to use with URLs containing API keys, tokens, or sensitive query parameters.
You Might Also Need
Related Tools
- Encoding a JSON payload as a URL parameter? Validate the JSON first to catch syntax errors early. β validate JSON before URL-encoding it
- Decoded a URL-encoded CSV string? Convert the JSON data to CSV for spreadsheet use. β export URL-decoded data to CSV
- Writing about URL encoding for developers? Publish the guide by converting Markdown to HTML. β document URL encoding in technical guides
- Signing URL parameters? Hash the encoded values with SHA-256 to create a request signature. β hash URL parameters for signing
- Working with CSS that contains encoded data URIs? Minify the whole stylesheet after encoding. β minify CSS with encoded content
- Decoded a URL-encoded HTML string? Use the HTML Formatter to beautify and read it. β format HTML with decoded URL content
- Got a URL-encoded SQL string? Decode it, then use the SQL Formatter to make it readable. β format URL-decoded SQL queries
- URL parameters often contain encoded timestamps. Decode and convert them with the Timestamp Converter. β decode URL-encoded timestamps
- URL encoding uses hex notation for characters. Use the Number Base Converter to interpret hex values. β convert hex-encoded values
- URLs sometimes carry hex color parameters. Use the RGB Converter to decode them to RGB. β decode hex color values from URLs
- Implementing URL encoding in .NET? See the C# syntax in the C# to VB.NET Converter. β see URL encoding in C# vs VB.NET
- Have URL encoding code in VB.NET? Translate it to C# instantly. β convert VB.NET URL encoding code to C#
- Automating URL encoding in a pipeline? Verify your cron schedule with the Cron Parser. β schedule URL encoding tasks
