URL Encoder & Decoder

Encode text for safe URLs, decode percent-encoded strings back to text. Free, instant, no signup.

ADSENSE_SLOT_TOP

Text to Encode 0 chars

Encoded Output
ADSENSE_SLOT_MIDDLE

How to Use This URL Encoder

  1. Choose Encode or Decode โ€” Use the tabs above to switch modes. The tool auto-detects: if your input contains percent-encoded patterns (%XX), it switches to Decode.
  2. Enter your text โ€” Encode mode: type or paste a URL or text with special characters. Decode mode: paste a percent-encoded string.
  3. Review both encoding results โ€” In Encode mode, get two outputs: encodeURIComponent (encodes everything, ideal for query parameter values) and encodeURI (preserves URL structure characters like /, ?, &).
  4. Copy or Swap โ€” Click the Copy button on any result, or Swap to flip the input with the encodeURIComponent output for round-trip testing.

Tip: Use Ctrl + Enter to trigger encode/decode.

Why Use This URL Encoder?

Two encoding modes in one

Unlike most URL encoders that only show a single result, this tool shows both encodeURIComponent and encodeURI side by side. Use encodeURIComponent when building query string parameters, and encodeURI when encoding a full URL without breaking its structure.

Complete privacy

All encoding and decoding happens in your browser. Your URLs and data never leave your device โ€” no server uploads, no logs, no tracking. Safe for encoding sensitive API endpoints, tokens, or proprietary URLs.

Helpful error messages

If you paste a malformed percent-encoded string (e.g., %ZZ or trailing %), the tool shows exactly where the problem is, so you can fix it quickly. No cryptic "URI malformed" messages.

Full Unicode support

Non-Latin characters like Chinese, Japanese, Arabic, and emoji are correctly encoded as UTF-8 byte sequences. For example, ไฝ ๅฅฝ becomes %E4%BD%A0%E5%A5%BD.

Frequently Asked Questions

When should I use encodeURIComponent vs encodeURI?

Use encodeURIComponent for individual query parameter values โ€” it encodes every special character including &, =, and ? that would break the URL structure. Use encodeURI for encoding an entire URL while preserving the URL syntax characters. For example, encoding the value of a q parameter in ?q=hello world should use encodeURIComponent to get ?q=hello%20world.

What does percent-encoding mean?

Percent-encoding (also called URL encoding) replaces unsafe or special characters with % followed by the character's hexadecimal byte value. For example, a space becomes %20. This ensures all characters in a URL are from the safe ASCII subset that can be transmitted reliably over the internet.

Can I decode a URL that was encoded by a different tool?

Yes. URL encoding is a standard (RFC 3986), so any properly encoded URL can be decoded by this tool. The decoder handles both %20 and + for spaces (since + is commonly used in query strings for spaces).

Why do some URLs use %20 and others use + for spaces?

In the query string part of a URL (after ?), spaces are often encoded as + due to the application/x-www-form-urlencoded MIME type used by HTML forms. In the path part of a URL, spaces must be encoded as %20. This tool's decode mode converts both %20 and + to spaces.

Is this tool free to use?

Yes, completely free. No signup, no download, no limits on usage.

More Free Tools

Browse other free online tools from TryTools โ€” all run in your browser with no signup required.