Skip to content
T
Tools.Town
Free Online Tools for Everyone
%20

URL Encoder / Decoder

100% Free

Encode or decode URLs and query parameters — supports both encodeURIComponent and encodeURI modes.

2 Encode Modes
Encode & Decode
Instant
Client-Side
https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26lang%3Den
encodeURIComponent encodes everything including / ? # & =.
encodeURI preserves URL structure (keeps / ? # &).

Embed This Tool

Easy to Embed

Add 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>

Share This Tool

Share Instantly

Share URL Encoder / Decoder with anyone — no login required.

  • Shareable link
  • No login required
  • Works on any device
  • No account needed

Share via

Advertisement

How to Use

  1. 1 Choose Encode or Decode mode using the toggle at the top
  2. 2 Select Component mode (encodes / ? # & =) or Full URL mode (preserves URL structure)
  3. 3 Paste your URL or text into the input area
  4. 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?
encodeURIComponent encodes everything including / ? # & =, suitable for encoding individual query parameter values. encodeURI preserves the URL structure (keeps / ? # &), suitable for encoding a complete URL.
When should I use encodeURIComponent?
Use it when encoding individual parameter values before appending to a URL — for example, a search term or redirect path that might contain special characters.
What is percent encoding?
Percent encoding (RFC 3986) replaces unsafe characters with a % followed by two hex digits. For example, a space becomes %20.
Can I decode malformed URLs?
The decoder will throw an error for invalid percent-sequences. The tool shows the error inline so you can identify the problem.

Related Tools You Might Like

Browse more free tools