URL Encoder / Decoder
100% FreeEncode or decode URLs and query parameters — supports both encodeURIComponent and encodeURI modes.
/ ? # & =.encodeURI preserves URL structure (keeps
/ ? # &).Embed This Tool
Easy to EmbedAdd URL Encoder / Decoder to your website or blog in seconds.
- Responsive design
- Lightweight & fast
- No backend required
- Always up-to-date
<iframe
src="https://tools.town/embed/url-encoder/"
width="100%"
height="600"
style="border:none; border-radius:12px;"
loading="lazy"
title="URL Encoder / Decoder">
</iframe> Advertisement
How to Use
- 1 Choose Encode or Decode mode using the toggle at the top
- 2 Select Component mode (encodes / ? # & =) or Full URL mode (preserves URL structure)
- 3 Paste your URL or text into the input area
- 4 The encoded or decoded result appears instantly — click Copy or Swap & Flip
Features
- Two encoding modes: Component (encodeURIComponent) and Full URL (encodeURI)
- Encode and Decode in one tool with a single toggle
- Swap & Flip reverses the operation using the current output as input
- Clear explanation of when to use Component vs Full URL mode
- Monospace font for easy reading of percent-encoded characters
- 100% browser-based — URLs never leave your device
Why it Matters
Malformed URLs are a top cause of broken API calls, 400 errors, and security vulnerabilities. Understanding when to use encodeURIComponent vs encodeURI — and having a fast tool to do it — is essential for any web developer working with query strings, redirects, or dynamic URLs.
Use Cases
API Development
Encode query parameters before appending them to API requests
Redirect Handling
Encode redirect target URLs in OAuth flows and authentication
Link Building
Safely encode UTM parameters for tracking URLs
Security Testing
Decode percent-encoded strings in logs and security audits
Frequently Asked Questions
What is the difference between Component and Full URL mode?
When should I use encodeURIComponent?
What is percent encoding?
Can I decode malformed URLs?
Want to understand the math?
URL Encoder Guide: encodeURIComponent vs encodeURI Explained
A developer's guide to the URL Encoder tool — when to use Component vs Full URL mode, which characters get encoded, decoding tips, and the bugs percent-encoding prevents.
25 Jun 2026
5 min read
URL Encoding Explained: When, Why & How to Percent-Encode
A developer's guide to URL encoding — what characters need encoding, how percent-encoding works in practice, common mistakes, and how to encode query strings correctly.
25 Jun 2026
5 min read
Related Tools You Might Like
Query String Builder
Build URL query strings from key-value pairs with proper percent-encoding, or parse and decode any URL's query parameters — instantly in your browser.
JSON Formatter
Beautify, minify, and sort-key JSON in real time. Surfaces parse errors with line + column. 100% client-side.
Base64 Encoder/Decoder
Encode plain text to Base64 or decode Base64 back to text — Unicode-safe, instant, browser-only.
HTML Entity Encoder
Encode and decode HTML entities both directions — escape &, <, >, quotes, and decode named, decimal, and hex entities back to text.
URL Parser
Break any URL into protocol, host, port, path, query parameters, and fragment — with subdomain, domain, and TLD detection. Parses live in your browser.