URL Encoder / Decoder

Encode special characters for URLs or decode encoded strings.

What is URL Encoding?

URL encoding (also called percent-encoding) replaces characters that are unsafe or reserved in URLs with a % followed by their two-digit hexadecimal ASCII code. For example, a space becomes %20 and an ampersand becomes %26. This ensures the URL is transmitted correctly across all systems and protocols without being misinterpreted.

How to Use the URL Encoder / Decoder

  1. Select Encode to convert plain text or a URL string into percent-encoded format, or Decode to reverse the process.
  2. Paste or type your input into the left text area.
  3. The converted result appears instantly in the right panel.
  4. Click the Copy icon to copy the output to your clipboard.
  5. Use the Clear button to reset both fields.
  6. If the encoded string is malformed, an error message will appear explaining the issue.

Common Use Cases

  • Query string parameters: Encode values passed as URL query parameters so special characters like &, =, and + do not break the URL structure.
  • API requests: Encode search terms or filters before appending them to API endpoint URLs.
  • Form submission debugging: Decode a URL-encoded form body captured in browser dev tools to inspect the actual field values.
  • Redirect URLs: Encode the destination URL when passing it as a parameter in a redirect or OAuth flow.
  • File paths in URLs: Encode filenames containing spaces or special characters for use in web server paths.
  • Log analysis: Decode percent-encoded URLs found in access logs to read the original request paths.

Why Use an Online URL Encoder?

URL encoding rules are subtle — not every character needs encoding, and different parts of a URL (path, query, fragment) have different reserved characters. Getting it wrong leads to broken links, failed API calls, or security vulnerabilities. An online tool handles all the rules for you instantly and lets you verify the encoded output before embedding it in code. Since everything runs in the browser, no URL or sensitive parameter data leaves your machine.

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a complete URL and leaves characters like /, ?, #, and & intact because they are structural parts of the URL. encodeURIComponent (used by this tool) encodes everything except letters, digits, and - _ . ! ~ * ' ( ), making it ideal for encoding individual query parameter values.

Why does a space sometimes appear as + instead of %20?

In the application/x-www-form-urlencoded format used by HTML forms, spaces are encoded as +. In standard percent-encoding (RFC 3986), spaces are encoded as %20. This tool uses the standard RFC 3986 format (%20), which is correct for URLs and API calls.

Are all characters encoded?

No. Letters (A–Z, a–z), digits (0–9), and the unreserved characters - _ . ! ~ * ' ( ) are left as-is because they are safe in all URL contexts. All other characters — including spaces, slashes, ampersands, and non-ASCII characters — are percent-encoded.

Related Tools

Explore more free developer tools: Base64 Converter — encode and decode Base64 strings. JSON Formatter — format and validate JSON for API work. JWT Decoder — decode JSON Web Token payloads and headers.