📝 Text & Content

URL Encoder / Decoder

Encode or decode URLs and query strings instantly. See results in real time — runs entirely in your browser.

How it works

URL encoding (also called percent-encoding) converts characters that are not allowed in URLs into a safe format. For example, a space becomes %20, an ampersand becomes %26, and non-ASCII characters like é become %C3%A9. This tool uses the browser's native encodeURIComponent and decodeURIComponent functions for accurate results. Everything runs locally — no data is sent to any server.

Why the URL Encoder / Decoder is Useful

URLs can only safely contain letters, numbers, hyphens, and underscores. Everything else — spaces, ampersands, accented characters, emoji — must be converted into a percent-encoded format before being used in a web address. If you've ever copy-pasted a URL and seen %20 or %C3%A9 in it, that's URL encoding at work. This tool handles both directions: encoding plain text into URL-safe format, and decoding encoded strings back to readable text.

Key Features

  • One-click encoding: Converts special characters, spaces, and non-ASCII text to safe percent-encoded format
  • One-click decoding: Turns percent-encoded strings back into plain, readable text
  • Swap button: Quickly reverse input and output to continue working in the other direction
  • Copy to clipboard: Copy the output with one click for immediate use
  • 100% browser-based: Nothing is sent to any server — works offline and handles sensitive strings safely

Real-Life Use Cases

  • Developers constructing API query strings with user-supplied text containing spaces or special characters
  • Marketers building UTM tracking links with campaign names like "Summer Sale 2025" that contain spaces
  • Sharing URLs that contain non-English characters (Arabic, Chinese, French accents) that need to be web-safe
  • Debugging broken links that look garbled — decode them to find out what the original string was
  • Backend developers encoding form field values before passing them in query parameters

Who Can Use This Tool

Web developers, backend engineers, digital marketers, SEO specialists, and QA testers. Also useful for non-technical users who need to fix a broken URL or make a link shareable across different platforms and languages.

Tips & Best Practices

  • If your string contains %25, it's double-encoded — run Decode twice to get back to the original text
  • For query parameters, encode only the values (not the = and & separators) to avoid breaking the URL structure
  • This tool uses encodeURIComponent, which is more thorough than encodeURI — it encodes all special characters including : / ? &
  • URL encoding is not encryption — never rely on it to hide sensitive data

Frequently Asked Questions

What is URL encoding?
URL encoding (percent-encoding) converts special characters into a format that can be safely transmitted in a URL. For example, a space becomes %20, an ampersand becomes %26, and é becomes %C3%A9. This ensures that URLs and query strings are interpreted correctly by browsers and servers.
When should I encode a URL?
You should encode URLs when passing special characters (spaces, &, =, ?, #, +), non-ASCII characters (like é, ü, 中文), or any characters that might be interpreted as URL delimiters. This is essential when building API requests, form query strings, or sharing links with special characters.
What characters need to be encoded?
Characters that typically need encoding include: spaces (%20 or +), ampersand (%26), equals sign (%3D), question mark (%3F), hash (%23), plus (%2B), slashes (%2F), and any non-ASCII characters like accented letters, CJK characters, or emoji.
What is the difference between encodeURIComponent and encodeURI?
encodeURI encodes only characters that are not allowed in a complete URL (like spaces), but preserves :/?&= which are needed in URLs. encodeURIComponent encodes all special characters, making it suitable for encoding individual query parameter values. This tool uses encodeURIComponent which is more thorough.
Can this tool handle already-encoded strings?
Yes. The Decode function will decode percent-encoded strings. If the input is already decoded, it will remain unchanged. The tool also handles double-encoded strings — run Decode multiple times to fully decode them.
Browse all tools Base64 Encoder HTML Viewer