URL Encode/Decode

Encode or decode URL strings with proper URL encoding.

Input
Output

                        

About URL Encode/Decode

URL encoding converts special characters to percent-encoded format. Use this tool to encode or decode URL strings.

Common Use Cases:

  • Encoding URLs with special characters
  • Encoding form data for URLs
  • Decoding encoded URLs
  • Preparing data for URL parameters

Developers: see the CI/CD & pipeline guide. More tutorials: guides hub · by Nalla.

URL encoding, percent-encoding and URI components

A URL (Uniform Resource Locator) can only contain a limited set of safe ASCII characters. Any other character, spaces, accented letters, symbols, non-Latin scripts, must be percent-encoded: replaced with % followed by the two-digit hexadecimal value of the character's UTF-8 byte. A space becomes %20, an ampersand becomes %26, the euro sign becomes %E2%82%AC (its three-byte UTF-8 sequence). This allows URLs to carry arbitrary text without breaking the parsing of protocol, host, path, query, and fragment components.

The standard distinguishes two encoding functions. encodeURI() encodes a complete URL, leaving structural characters (/, ?, &, =, #) unencoded because they have meaning within the URL. encodeURIComponent() encodes everything including those structural characters, use it for individual query parameter values. A common bug is calling encodeURI() on a query value containing &, which then splits the query string incorrectly.

CharacterEncoded formWhere it appears
Space%20Path and query values
&%26Inside query parameter values
=%3DInside query parameter values
+%2BQuery values (+ means space in form encoding)
#%23Inside query/path (# starts the fragment)
Non-ASCII (e.g. ü)%C3%BCUTF-8 bytes percent-encoded

Decoding for debugging and inspection

Paste an encoded URL or query string here and click Decode to make it human-readable. This is useful for debugging API request logs (server access logs show percent-encoded URLs), inspecting tracking parameters in marketing links, reading encoded OAuth redirect URIs, and understanding what data a form is submitting. Paste the full URL or just the query string, the decoder handles both.

Related: Base64 encoder for binary-to-text encoding, JSON formatter for API query values that contain JSON.

Frequently Asked Questions

URL encoding (percent-encoding) replaces unsafe characters with a % followed by their hexadecimal ASCII code. Characters that must be encoded include: spaces (→ %20), & (→ %26), = (→ %3D), + (→ %2B), / (→ %2F), ? (→ %3F), # (→ %23), and non-ASCII characters like accented letters and emoji. Safe characters that don't need encoding are letters, digits, and - _ . ~

Both %20 and + represent spaces in URLs, but in different contexts. %20 is used in the path component of a URL (e.g., /my%20page). The + sign represents a space only in the query string component (e.g., ?q=hello+world), following the older "application/x-www-form-urlencoded" convention. Our encoder uses %20 for all spaces, which is safe in all URL contexts.

Use encodeURIComponent() in JavaScript (or equivalent in other languages) whenever you include user-provided values in a URL, search terms, usernames, file names, or any dynamic data. Failing to URL-encode can break links if the data contains &, =, or / characters, and can create security vulnerabilities (open redirect, parameter injection) if the data contains # or ? characters.