URL Encoder

Percent-encode text for safe use in URLs or decode percent-encoded strings instantly in your browser. Supports encodeURIComponent and encodeURI modes.

url encode decode percent urlencode
Free Client-Side Private
🔒 This tool runs entirely in your browser — your files are never uploaded to any server.

The URL Encoder/Decoder is a free, browser-based tool that percent-encodes text for safe use in URLs, or decodes percent-encoded strings back to readable text. All processing runs entirely in your browser — nothing is ever sent to a server.

Features

Feature Detail
Encode Converts characters that are not safe in URLs to %XX sequences
Decode Converts %XX percent-encoded sequences back to their original characters
encodeURIComponent Encodes all characters except A-Z a-z 0-9 - _ . ! ~ * ' ( ) — best for query string values and path segments
encodeURI Preserves URL structure characters (: / ? # [ ] @ ! $ & ' ( ) * + , ; =) — best for encoding a complete URL
Smart decode Tries decodeURIComponent first, falls back to decodeURI for full URLs
Stats Shows input size, output size, and the number of percent-encoded sequences
Copy One-click copy to clipboard

How to Use

Encoding

  1. Click the Encode tab (active by default).
  2. Paste the text or URL you want to encode.
  3. Select the Encoding mode: encodeURIComponent for individual values, or encodeURI for a complete URL.
  4. Click Encode URL and copy the result.

Decoding

  1. Click the Decode tab.
  2. Paste the percent-encoded string.
  3. Click Decode URL and copy the result.

encodeURIComponent vs encodeURI

Use this when encoding a single value that will be placed inside a URL — for example, a search query, a filename, or a parameter value. It encodes everything except A-Z a-z 0-9 - _ . ! ~ * ' ( ), including :, /, ?, &, and =, which would otherwise break URL parsing.

Example: the string price=10&currency=USD becomes price%3D10%26currency%3DUSD, safe to embed as a single query parameter value.

encodeURI (for complete URLs)

Use this when encoding a complete URL that already has valid structure — scheme, host, path, and query. It leaves the structural characters (: / ? # [ ] @ ! $ & ' ( ) * + , ; =) untouched so the URL remains navigable, and only encodes characters that are illegal in a URL such as spaces and non-ASCII characters.

Example: https://example.com/path with spaces becomes https://example.com/path%20with%20spaces.

When to URL-Encode

  • Query string values — always encode user-supplied values before appending them to a URL to prevent parameter injection
  • Form submissions — browsers encode form data automatically, but manual fetch calls or URL construction require encoding
  • Path segments — file names or identifiers containing special characters must be encoded before insertion into a URL path
  • HTTP headers — some header values (e.g. Location, Content-Disposition: filename=) require percent-encoding for non-ASCII characters
  • Decoding API responses — URLs returned by APIs or stored in databases are often percent-encoded and need decoding for display

Frequently Asked Questions

What characters does URL encoding affect?

Any character outside the set A-Z a-z 0-9 - _ . ! ~ * ' ( ) is encoded as one or more %XX sequences, where XX is the hexadecimal value of each UTF-8 byte. Spaces become %20 (or + in HTML form encoding, which this tool does not use).

What is the difference between %20 and + for spaces?

%20 is the standard percent-encoded space used in path segments and encodeURIComponent. The + notation for spaces is specific to application/x-www-form-urlencoded (HTML form data) and is not produced by this tool. Both decode to a space, but they are not interchangeable in all contexts.

Can I decode a full URL with query parameters?

Yes. Paste the complete URL and click Decode URL. The tool attempts decodeURIComponent first; if that fails (e.g. for a URL with structural characters like ://), it automatically falls back to decodeURI.

Are my inputs stored or logged?

Never. All encoding and decoding happens locally in your browser using the native encodeURIComponent, encodeURI, decodeURIComponent, and decodeURI JavaScript functions. Nothing is transmitted anywhere.

What does the "Encoded chars" stat show?

It counts the number of %XX sequences in the output (Encode mode) or the input (Decode mode), giving a quick indication of how many characters required encoding.

Report an issue