About URL Encode / Decode
Comprehensive Overview
The URL Encoder / Decoder converts special characters in URLs to their percent-encoded equivalents and back. Percent-encoding (also known as URL encoding) replaces unsafe ASCII characters with a % followed by two hexadecimal digits representing the character's byte value. This is essential for building valid query strings, encoding form data, and safely embedding special characters in URLs.
Key Features
- Two Encoding Modes — Choose between component encoding (encodes all special characters including
/,?,&) and full URL encoding (preserves URL structure while encoding only unsafe characters within each part). - RFC 3986 Compliant — Follows the official URI specification for percent-encoding. Characters outside the unreserved set (
A-Z a-z 0-9 - _ . ~) are encoded correctly. - Bidirectional — Encode plain text to URL-safe format or decode percent-encoded strings back to readable text with a single click.
- Unicode Support — Handles UTF-8 multi-byte characters correctly, encoding them as a sequence of percent-encoded bytes.
How to Use
- Select the mode: Encode to convert text to URL-safe format, or Decode to convert percent-encoded strings back.
- Choose the encoding type: Component (recommended for query parameter values) or Full URL (for complete URLs).
- Paste or type your text and click Process.
- Copy the result to your clipboard with one click.
When to Use URL Encoding
- Query Parameters — Encode values that contain spaces, ampersands, or other special characters before appending them to a URL.
- Form Data — Encode form field values when building GET request URLs or submitting data via
application/x-www-form-urlencoded. - API Requests — Ensure parameter values are properly encoded when calling REST APIs.
- Debugging — Decode a percent-encoded URL to see the original human-readable text for troubleshooting.
Technical Background
URL encoding was introduced in RFC 1738 and refined in RFC 3986 (Uniform Resource Identifier). In JavaScript, encodeURIComponent() corresponds to component mode, while encodeURI() corresponds to full URL mode. In PHP, urlencode() and rawurlencode() handle encoding, while urldecode() and rawurldecode() reverse the process. The main difference is that rawurlencode encodes spaces as %20 (RFC 3986), while urlencode encodes them as + (legacy form encoding).