URL Encoder & Decoder

Encode and decode URLs instantly using all four JavaScript encoding methods. Includes URL breakdown, query parameter inspector, and operation history. 100% private — nothing leaves your browser.

Encodes all special characters including / : @ ? # & = — best for query parameter values.

0
Input · chars
0
Output · chars
0
Encoded · %XX seqs
Size · change
Input
Output

How to use the URL encoder and decoder

Select the encoding mode using the tabs at the top. Paste or type your text into the left panel — the result appears instantly in the right panel as you type. Use Encode Component for query parameter values, and Encode URL when encoding a full URL.

The Swap button moves the output back to the input and automatically flips the mode — so after encoding, one click lets you decode the result to verify it roundtrips correctly.

When your input is a valid URL, the URL Analysis panel appears automatically. It breaks the URL into protocol, hostname, path, query string, and hash fragment, and shows all query parameters decoded as key/value pairs.

Which encoding mode should I use?

encodeURIComponent is the most common choice. It encodes everything except letters, digits, and - _ . ! ~ * ' ( ). Use this when encoding a value that will appear inside a query string — for example, a search term, an email address, or any user-generated text.

encodeURI is for encoding a complete URL. It preserves the characters that have structural meaning in a URL: : / ? # & = + @ ,. Use this when you have a full URL with spaces or non-ASCII characters that need escaping.

The decode variants reverse each operation. If you received a percent-encoded string and want to read it, use decodeURIComponentfor values and decodeURI for full URLs.

Features

  • 4 encoding modes — encodeURIComponent, decodeURIComponent, encodeURI, decodeURI
  • Real-time output — result updates as you type with no button press needed
  • Input stats — character count, encoded sequence count, size change percentage
  • URL breakdown panel — automatically parses valid URLs into their components
  • Query parameter inspector — shows each decoded key/value pair from the query string
  • Swap button — moves output to input and flips encode↔decode mode
  • Copy and Download output with one click
  • Operation history — last 5 operations saved in your browser
  • Error handling — clear message for malformed %XX sequences
  • 100% private — all processing runs in your browser, nothing is transmitted

What is URL encoding?

URL encoding (also called percent-encoding) converts characters that are not allowed in URLs into a safe format. Each character is replaced by a percent sign followed by two hex digits representing the character's ASCII or UTF-8 value. For example, a space becomes %20, and & becomes %26.

Encoding is necessary because URLs can only contain a limited set of characters. When you submit a form, search for something online, or build an API request, the browser or your code must encode special characters to keep the URL valid.

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent encodes everything except unreserved characters (letters, digits, - _ . ! ~ * ' ( )). It will encode /,?, #, and &. encodeURI is less aggressive — it preserves those characters because they have structural meaning in a URL. Use encodeURIComponent for individual values inside a query string, and encodeURI for a complete URL.

Why do I get an "encoding error" message?

This happens when you try to decode a string that contains an invalid or incomplete percent sequence — for example %gg (not valid hex) or a lone% without two following hex digits. Check your input for any incomplete percent sequences and correct them.

How do I decode a full query string?

Paste the full URL (including https://) into the input. The URL Analysis panel will appear and show every query parameter decoded as a key/value pair. Alternatively, select Decode Component mode and paste just the query string portion to see the decoded values inline.

Is my data private?

Yes. All encoding and decoding uses built-in browser JavaScript functions (encodeURIComponent, decodeURIComponent, encodeURI, decodeURI). Nothing is sent to any server. Your input never leaves your browser.

Can I encode Unicode characters and emojis?

Yes. The tool supports full Unicode input. Characters outside the ASCII range (including emojis and accented letters) are UTF-8 encoded and then percent-encoded. For example, café becomes caf%C3%A9 and😊 becomes %F0%9F%98%8A.

What does the Swap button do?

The Swap button copies the current output into the input field and automatically flips the mode — encode switches to decode, and vice versa. This lets you verify a roundtrip (encode then decode) in two clicks, or quickly reverse an operation.

Related tools