URL Encoder / Decoder

Encode special characters in URLs, or decode percent-encoded URL strings back to plain text.

πŸ“„ Drop a .txt file here, or

What This Tool Does

Encodes and decodes URLs and query strings in your browser using percent-encoding (RFC 3986). Handles full URLs, individual parameters, and special characters correctly.

Who This Is For

  • Backend developers constructing API request URLs with special characters or non-ASCII input
  • Frontend engineers debugging query string parameters that are being double-encoded
  • Anyone building a URL that includes spaces, ampersands, or international characters
  • QA engineers testing URL handling edge cases in web applications

Example: Input: A URL with spaces and special characters like https://example.com/search?q=hello world & more → Output: Encoded: https://example.com/search?q=hello%20world%20%26%20more β€” safe for any HTTP request


πŸ’‘ URL encoding is often needed when constructing API requests that also contain JSON payloads. Use the JSON Formatter to validate the request body before encoding, and the Base64 Encoder for encoding binary data in query parameters.

How to Encode and Decode URLs

Paste a URL, query string, or any text into the input field and click Encode or Decode. The result appears immediately in the output panel, ready to copy.

What Is URL Encoding (Percent Encoding)?

URL encoding (formally called percent-encoding) converts characters that are not allowed in URLs into a safe format. The format is a percent sign followed by two hexadecimal digits representing the character's ASCII code.

CharacterEncodedWhere it appears
Space%20 (or +)Query strings, form data
&%26Within parameter values
=%3DWithin parameter values
?%3FWithin parameter values
/%2FPath segments with slashes in values
#%23Fragment identifiers in values
+%2BWhen literal + is needed, not space
@%40Email addresses in URLs

When to Encode a Full URL vs Just a Parameter Value

This is a critical distinction many developers get wrong:

Common URL Encoding Use Cases

URL and Web Encoding Tools

URL encoding is part of a web development and API workflow:

Frequently Asked Questions

What's the difference between encodeURI and encodeURIComponent?
encodeURIComponent encodes all special characters including /, ?, =, & β€” use this for individual query parameter values. encodeURI preserves URL structure characters like / and ? β€” use this for encoding a complete URL. This tool provides both modes.
Why does a space sometimes encode as + and sometimes as %20?
In query strings (application/x-www-form-urlencoded encoding), spaces are encoded as +. In URL path encoding (percent encoding), spaces are encoded as %20. Both are valid in their respective contexts. This tool uses %20 (standard percent encoding) by default.
What characters need to be URL encoded?
Characters outside the ASCII alphanumeric range and the unreserved characters (- _ . ~) must be encoded. This includes spaces, /, ?, #, &, =, @, and all non-ASCII characters (accented letters, emoji, CJK characters).
Why is my URL breaking when I include it in another URL?
When a URL appears as a query parameter value inside another URL, it must be fully encoded so its own /, ?, and & characters don't break the outer URL's structure. Encode the inner URL with encodeURIComponent, not encodeURI.
Can I decode a URL that's been double-encoded?
Yes β€” paste the double-encoded URL and decode it. If it's still encoded after one decode, decode it again. Double-encoding produces %25XX patterns (% encoded as %25).
Does URL encoding change the meaning of the URL?
No β€” encoding is lossless. A URL and its encoded equivalent refer to the same resource. Servers decode encoded URLs before processing them.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL (preserving / : ? etc). encodeURIComponent encodes all special characters including / and ?.

How It Works

1
Paste your URL or stringEnter a URL, query parameter, or any string that needs encoding for safe use in a URL.
2
Choose encoding typeFull URL encode (encodes everything including slashes) or component encode (encodes query parameter values only).
3
Copy the encoded outputThe encoded string is generated instantly in your browser. Copy to clipboard and use in your API call or link.

When to Use This Tool

  • β†’Encoding a URL that contains spaces, ampersands, or special characters before using it in a query string
  • β†’Debugging a URL that's being incorrectly encoded or double-encoded
  • β†’Building API request URLs that include JSON or structured data in query parameters
  • β†’Decoding a URL-encoded string from a server log or error message to see the original value

πŸ”’ Privacy & Security

URL encoding and decoding uses JavaScript's built-in encodeURIComponent() and decodeURIComponent() functions β€” no data leaves your browser. Safe to use with URLs containing API keys, tokens, or sensitive query parameters.

You Might Also Need

Base64 Encoder β†’JWT Decoder β†’JSON Formatter β†’

Related Tools