URL Encoder & Decoder — Complete Guide
What is URL Encoding?
URL encoding (also called percent-encoding) converts special characters into a web-safe format using % followed by two hex digits. URLs can only contain a limited set of safe ASCII characters, so spaces, quotes, emojis, and reserved symbols must be encoded before they travel over the network. For example, a space becomes %20, @ becomes %40, and & becomes %26.
URL decoding is the reverse process — it restores encoded characters back to their original form. This tool lets you encode and decode URLs, query parameters, and any text instantly, all in your browser.
How URL Encoding Works
Every reserved or unsafe character is replaced by a percent sign followed by its UTF-8 byte value in hexadecimal. Here are the most common conversions:
| Character | Encoded | Why |
|---|---|---|
| Space | %20 | Spaces break URLs and are not allowed |
| @ | %40 | Reserved in email-style URLs |
| & | %26 | Separates query parameters |
| = | %3D | Separates keys and values in query strings |
| ? | %3F | Starts the query string |
| / | %2F | Separates path segments |
| # | %23 | Starts a fragment identifier |
Example
Hello World! → Hello%20World%21
email@example.com → email%40example.com
name=Ranjan & age=30 → name%3DRanjan%20%26%20age%3D30
Encode vs Decode
Encode (Text → %XX)
Use before sending data in a URL, query parameter, or API request. Prevents reserved characters from breaking the URL.
Decode (%XX → Text)
Use when reading URLs, logs, or API responses. Restores percent-encoded strings to their original readable form.
Features of This Tool
Encode & Decode
Convert text to percent-encoded form and back.
Real-Time
Results update instantly as you type.
Save Conversions
Save up to 999 conversions in your browser.
Copy to Clipboard
One-click copy for the output.
Unicode Support
Handles emojis, multilingual text, and special symbols.
100% Private
Everything runs in your browser — no server, no storage.
Delete Anytime
Remove saved conversions with confirmation.
Large Text
Works with long URLs, JSON payloads, and multi-line text.
Common Use Cases
- API development: Encode query parameters and path segments so reserved characters do not break requests.
- Web forms: Encode user input before adding it to GET requests.
- Link sharing: Safely share URLs containing spaces, emojis, or special symbols.
- Debugging: Decode encoded URLs from logs, browser history, and API responses.
- Marketing: Build trackable UTM links with encoded parameters.
- Testing: Validate URL encoding behavior in web apps.
Security & Privacy
URL encoding is not encryption. Anyone can decode a percent-encoded string. It exists to ensure safe transmission, not confidentiality. Always use HTTPS for real security. This tool runs entirely in your browser — your data is never uploaded, logged, or stored anywhere. Saved conversions are kept only in your browser localStorage and can be deleted at any time.
Common Errors & Fixes
- Double encoding: Encoding an already-encoded string produces %2520 instead of %20. Decode first if the input is already encoded.
- Encoding the wrong characters: Use encodeURIComponent for values and encodeURI for full URLs — mixing them breaks query strings.
- Malformed percent sequences: % must be followed by two hex digits. A stray % breaks decoding.
- Not encoding reserved characters: Characters like &, =, ?, # must be encoded when meant as literal data.
Frequently Asked Questions
What is URL encoding?
URL encoding (also called percent-encoding) converts special characters into a web-safe format using % followed by two hex digits. For example, a space becomes %20, @ becomes %40, and & becomes %26. This ensures URLs transmit correctly over the internet without breaking.
What is URL decoding?
URL decoding is the reverse process — it converts percent-encoded characters back into their original form. For example, %20 becomes a space, %40 becomes @, and %26 becomes &. It is useful for reading encoded URLs and query parameters.
Why do I need URL encoding?
URLs can only contain a limited set of safe ASCII characters. Spaces, quotes, emojis, and special symbols can break a URL or cause the browser to interpret it incorrectly. URL encoding ensures every character is transmitted safely and the server receives the exact intended data.
What is the difference between encodeURI and encodeURIComponent?
encodeURI is used for encoding a full URL and preserves characters like :, /, ?, &, =, and #. encodeURIComponent is used for encoding a single value (like a query parameter) and encodes those reserved characters too. Use encodeURIComponent for individual parameters and encodeURI for full URLs.
What is the difference between URL encoding and HTML encoding?
URL encoding converts characters into percent-encoded form (%20, %26) for transmission in URLs. HTML encoding converts characters into HTML entities (<, >, &) for safe rendering in HTML. They solve different problems — URL encoding for URLs, HTML encoding for HTML content.
Does URL encoding make data secure?
No. URL encoding is not encryption. It only ensures safe transmission. Anyone can decode it. Use HTTPS and proper encryption if you need to protect sensitive data.
Which characters must always be encoded?
The characters space, ", <, >, #, %, {, }, |, \, ^, ~, [, ], and ` should always be encoded. Reserved characters like :, /, ?, &, =, +, $, ,, and ; have special meaning in URLs and must be encoded when they are meant as literal data.
Can I encode emojis and non-English text?
Yes. URL encoding uses UTF-8, so emojis, Chinese, Hindi, Arabic, and all Unicode characters are safely encoded. A single emoji can become multiple %XX sequences because it is multi-byte UTF-8.
Can I use this tool for API development?
Yes. URL encoding is essential for REST APIs, GraphQL, and webhooks. Encode query parameters and path segments so reserved characters do not break the request. This tool is perfect for building and debugging API requests.
Pro Tip
Use encodeURIComponent for individual query parameter values and encodeURI for full URLs. Mixing them can double-encode separators or leave reserved characters unescaped.