URL Encoder & Decoder

Encode and decode URLs instantly. Convert special characters to percent-encoded format or decode them back.

Two-way syncRFC 3986 compliantNo data stored
Raw Text
Type or paste your URL or text to encode
Encoded URL
Type or paste an encoded URL to decode it

What is URL Encoding?

URL encoding (also called percent-encoding) converts characters that are not allowed in a URL into a safe representation using a percent sign followed by two hexadecimal digits — for example, a space becomes %20 and an ampersand becomes %26. The URL specification (RFC 3986) defines a set of "unreserved" characters that can appear as-is (letters, digits, - . _ ~); everything else must be encoded before being included in a URL.

Common Use Cases

  • Encode query parameter values that contain spaces, special characters, or non-ASCII text
  • Build URLs programmatically from user-supplied input without breaking link structure
  • Decode percent-encoded URLs from browser address bars or server logs
  • Safely pass JSON or structured data as a URL parameter
  • Fix "invalid URL" errors caused by unencoded characters in API requests

How It Works

This tool uses JavaScript's encodeURIComponent() for component encoding (encodes everything except unreserved characters) and encodeURI()for full URL encoding (preserves structural characters like ://?=&). Decoding uses decodeURIComponent(). All processing happens in your browser — nothing is sent to a server.

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?

encodeURI is designed for full URLs — it preserves characters like :, /, ?, and # that have structural meaning. encodeURIComponent encodes those characters too, making it suitable for individual query parameter values.

Why is a space sometimes encoded as + instead of %20?

The + encoding for spaces is part of the application/x-www-form-urlencoded format used by HTML forms — it is not standard percent-encoding. Modern APIs typically prefer %20; always check what the target system expects.

Do I need to encode the entire URL or just parts of it?

Only encode the dynamic parts — query parameter names and values, path segments that contain special characters. Encoding the whole URL would break the structural characters (://, /, ?, &) that define URL structure.

What is URL encoding? URL encoding (percent-encoding) replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits, ensuring URLs are transmitted correctly over the internet.

Uses encodeURIComponent / decodeURIComponent — all conversions happen locally in your browser.