EVMTools

URL Encoder / Decoder

Encode and decode URL components online. Compare encodeURIComponent vs encodeURI with a common URL encodings reference table.

Examples

Common URL Encodings

CharacterEncodedCharacterEncoded
(space)%20&%26
=%3D?%3F
#%23/%2F
@%40+%2B

About URL Encoding

  • URL encoding (percent-encoding) replaces unsafe characters with %HH hex values per RFC 3986
  • encodeURIComponent encodes everything except A-Z a-z 0-9 - _ . ~ ! * ' ( )
  • encodeURI additionally preserves : / ? # [ ] @ ! $ & ' ( ) * + , ; =
  • Use encodeURIComponent for query parameter values, form data, and API payloads
  • Use encodeURI when encoding a complete URL while preserving its structure

How to Use This URL Encoder / Decoder

This tool converts text to and from percent-encoded URL format instantly in your browser. It supports both encodeURIComponent and encodeURI modes, so you can handle everything from individual query parameters to full URLs containing Unicode characters.

  1. Paste your URL or text into the input area. This can be a full URL, a query string value, or any text containing special characters.
  2. Select the operation — choose Encode to convert special characters to percent-encoded format, or Decode to convert percent-encoded strings back to readable text.
  3. Choose the encoding mode when encoding. Use encodeURIComponent for query parameter values and encodeURI for complete URLs where you want to preserve structural characters like :// and ?.
  4. Copy the result with a single click and paste it into your code, API client, or browser address bar.

Everything runs client-side in your browser. Your URLs and data are never sent to any server, which is important when working with API keys, authentication tokens, or sensitive query parameters in blockchain RPC endpoints.

Common Use Cases

  • API query parameters — Encode values containing special characters like &, =, and + before appending them to REST API or GraphQL request URLs.
  • Form data encoding — Prepare user-submitted data for application/x-www-form-urlencoded POST requests by encoding each field value.
  • Redirect URLs — Encode callback and redirect URLs passed as query parameters in OAuth flows to prevent breaking the outer URL structure.
  • Webhook payloads — Encode URLs embedded in webhook configurations for services like Discord, Slack, or on-chain event notification systems.
  • Ethereum JSON-RPC URLs — Encode API keys and special characters in Alchemy, Infura, or QuickNode RPC endpoint URLs used in wallet and dApp configurations.

Related Tools

Frequently Asked Questions

What is URL encoding (percent encoding)?

URL encoding, also called percent encoding, replaces unsafe or reserved characters in a URL with a percent sign (%) followed by two hexadecimal digits representing the character's ASCII value. For example, a space becomes %20 and an ampersand becomes %26.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URI but preserves characters that have special meaning in URLs like ://?#@. encodeURIComponent encodes everything except letters, digits, and - _ . ~ making it suitable for encoding individual query parameter values.

Why do URLs need to be encoded?

URLs can only contain a limited set of ASCII characters. Special characters like spaces, ampersands, and non-ASCII characters (such as Unicode) must be percent-encoded so that servers and browsers interpret the URL correctly without ambiguity.

Which characters are safe to use in a URL without encoding?

Unreserved characters that do not require encoding include uppercase and lowercase letters (A-Z, a-z), digits (0-9), and four special characters: hyphen (-), underscore (_), period (.), and tilde (~). All other characters should be percent-encoded when used in URL components.

What does %20 mean in a URL?

%20 is the percent-encoded representation of a space character. Some systems use a plus sign (+) instead of %20 to represent spaces in query strings, but %20 is the standard encoding defined by RFC 3986.

How do I encode special characters in API query parameters?

Use encodeURIComponent on each parameter key and value before joining them with & and =. This ensures characters like &, =, and + within values are properly escaped and not mistaken for URL delimiters.