URL Encode / Decode
URL encode special characters for safe use in web addresses. Decode URL-encoded strings back to readable text. Encode special characters in URLs for safe web transmission. Decode encoded URLs back to readable text for web development work.
Enter Values
Fill in the fields and press Calculate to see instant results.
URL Encoder & Decoder (Percent-Encoding)
URLs are fragile. Because the infrastructure of the internet was built on the standard ASCII character set, web addresses simply cannot contain spaces, emojis, foreign language characters, or certain symbols. If you try to pass these characters in a URL, the link will break. Our free URL Encoder/Decoder instantly converts unsafe text into safe, percent-encoded strings ready for use in web development and API requests.
This tool runs entirely in your browser. Whether you are debugging a complex REST API payload, constructing affiliate tracking links, or fixing broken href tags, your data is processed locally and never sent to a server.
π‘ Developer Tip: The most common URL bug is failing to encode the ampersand (&) when it is part of your data (like a company name: "AT&T"). If unencoded, the web server will interpret the & as the start of a new query parameter, completely corrupting your data. AT&T must be encoded as AT%26T.
When to Use This URL Encoder
π Constructing Query Parameters
When appending user input to a URL (e.g., ?search=user input), you must encode it to ?search=user%20input to ensure the browser routes it correctly.
π Debugging API Requests
Paste massive, unreadable URL strings from your network tab into the Decoder to easily read the JSON or parameter data being passed between the frontend and backend.
π± Appending UTM Tracking Codes
Marketers building UTM tracking links must ensure that campaign names containing spaces or special symbols are properly percent-encoded before launching ad campaigns.
π§ Building mailto: Links
If you want an HTML link to open an email client with a pre-filled subject and body, the subject and body text must be strictly URL encoded.
π Handling Internationalization
URLs containing non-English characters (like Arabic, Cyrillic, or Chinese) must be UTF-8 encoded and then URL percent-encoded for global compatibility.
ποΈ Database ID Routing
If your database uses string IDs that happen to contain slashes or plus signs, they will break your REST API routes (e.g., /users/id/name) unless properly encoded.
URL Encoding Formula & Rules
URL encoding (officially defined in RFC 3986) divides all characters into two buckets: Reserved and Unreserved.
Unreserved Characters (Never Encode)
These characters are safe. The encoder will ignore them:
A-Z, a-z, 0-9, hyphen (-), underscore (_), period (.), tilde (~)
Reserved Characters (Must Encode If Used as Data)
These characters have structural meaning in a URL. If you want to use them as actual text data, you MUST encode them.
| Character | Meaning in URL | Encoded Value |
|---|---|---|
| Space | Invalid character | %20 |
| ! | Reserved | %21 |
| # | Fragment identifier (anchor) | %23 |
| $ | Reserved | %24 |
| % | Escape character | %25 |
| & | Query parameter separator | %26 |
| + | Often implies Space in query strings | %2B |
| / | Path separator | %2F |
| : | Scheme separator (http:) | %3A |
| ? | Start of query string | %3F |
| = | Query key/value separator | %3D |
5 Worked Examples
Example 1: Basic Search Query
User Input (Search Box):
New York Pizza
Encoded URL:
https://example.com/search?q=New%20York%20Pizza
Note: The spaces are replaced with %20. Without this, the URL breaks after "New".
Example 2: The Ampersand Danger
Company Name Data:
Barnes & Noble
Properly Encoded URL:
?company=Barnes%20%26%20Noble
The Danger: If you don't encode it (?company=Barnes & Noble), the server thinks you are sending two parameters: company=Barnes and a second parameter named Noble with no value.
Example 3: Passing URLs inside URLs
Sometimes you need to pass a redirect URL as a parameter.
Redirect Target: https://google.com/search?q=cats
Properly Encoded Full URL:
https://myapp.com/login?redirect=https%3A%2F%2Fgoogle.com%2Fsearch%3Fq%3Dcats
Notice how the colons, slashes, question marks, and equals signs of the target URL must ALL be encoded so they don't interfere with the main app's URL structure.
Example 4: Pre-filling Emails with mailto:
Desired Subject/Body:
Subject: Hello World!
Body: 100% ready.
Encoded Href Attribute:
mailto:admin@site.com?subject=Hello%20World%21&body=100%25%20ready.
The exclamation point becomes %21, and the percent sign itself must be encoded to %25.
Example 5: Emojis in URLs
User Input:
I β€οΈ Code
Encoded String:
I%20%E2%9D%A4%EF%B8%8F%20Code
Emojis are multibyte UTF-8 characters. The encoder converts the heart emoji into its raw byte representation and percent-encodes each individual byte.
Frequently Asked Questions
βΆWhat is URL Encoding (Percent-Encoding)?
βΆWhy do spaces become %20 in URLs?
βΆWhat are 'Reserved' characters?
βΆIs URL encoding the same as Base64?
βΆIs URL encoding different from HTML encoding?
βΆWhy did my string become %2520?
Related Developer Tools
Explore our other tools designed for developers and content creators:
Base64 Encoder
Encode files, API keys, and JWT payloads into safe Base64 ASCII text format.
Password Generator
Generate secure, randomized passwords or API tokens for your web applications.
Subnet Calculator
Plan your AWS/Azure VPCs by calculating IP ranges and CIDR blocks instantly.
Bandwidth Calculator
Calculate exact data transfer times based on file size and connection speed.
People Also Calculate
Calculators visitors commonly use alongside this one.