Yantrasagaram

URL Encoder / Decoder

URLs can only contain a limited set of characters defined by the URI specification. When you need to pass special characters — spaces, ampersands, non-ASCII letters, or emoji — through a URL, they must be percent-encoded first. For binary-to-text encoding instead, see the Base64 Encoder / Decoder. This free online tool lets you encode plain text into a URL-safe format or decode an already-encoded string back to readable text. You can choose between Component mode, which encodes every special character for use inside a single query-string value, and Full URL mode, which preserves structural characters like colons and slashes. Need a clean, readable slug for your page URL? Try the Slug Generator. Character counts for both input and output are displayed so you can track size changes. Everything runs locally in your browser, so no data leaves your machine. Copy the result to your clipboard with a single click and paste it wherever you need it.

Mode:
0 characters

How to Use This Tool

  1. Choose the direction: Encode to convert plain text into a URL-safe string, or Decode to convert a percent-encoded string back to readable text.
  2. Select the mode: Component for encoding individual query-string values (encodeURIComponent), or Full URL for encoding a complete URL while preserving its structure (encodeURI).
  3. Paste or type your text into the input area and click the action button to see the result instantly.
  4. Click the copy button to place the result on your clipboard, ready to paste into your code, browser address bar, or API request.

Examples

Encoding a Query-String Value (Component Mode)

Input (plain text)

hello world & welcome=true

Output (encoded)

hello%20world%20%26%20welcome%3Dtrue

Encoding a Full URL with Non-ASCII Characters

Input (full URL)

https://example.com/search?q=cafe latte

Output (encoded, Full URL mode)

https://example.com/search?q=cafe%20latte

Decoding a Percent-Encoded String

Input (encoded)

price%3D19.99%26currency%3DUSD

Output (decoded)

price=19.99&currency=USD

What This Tool Is Useful For

Frequently Asked Questions

What is URL 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 byte value. For example, a space becomes %20 and an ampersand becomes %26. This ensures the URL is interpreted correctly by browsers and servers.
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent encodes almost every special character, including slashes, colons, and question marks. It is designed for encoding individual query-string values or path segments. encodeURI, on the other hand, leaves characters that are valid in a complete URL (such as ://?#&=) untouched. Use encodeURI when you have a full URL that just needs its non-ASCII characters encoded, and encodeURIComponent when you are encoding a single parameter value.
When should I URL-encode my data?
You should URL-encode data whenever you embed user input into a query string, form submission, or URL path segment. If the data contains characters like spaces, ampersands, equals signs, or non-ASCII characters, failing to encode them can break the URL or cause the server to misinterpret the request.
Does this tool send my data to a server?
No. All encoding and decoding happens entirely in your browser using built-in JavaScript functions. Nothing is transmitted to any server, so your data stays private.
Can I decode a full URL with query parameters?
Yes. Switch to Full URL mode and paste the entire encoded URL. The decoder will restore percent-encoded characters back to their readable form while preserving the URL structure. If you only need to decode a single query-string value, use Component mode instead.

More Developer Tools

Need to encode binary data as text? Base64 Encoder / Decoder. Working with JSON? JSON Formatter & Validator. Need a unique identifier? UUID Generator. Convert timestamps? Unix Timestamp Converter. Turn any URL into a scannable QR Code. Browse all utilities in the Developer Tools hub.

Related Tools