Developer Tools

URL Encoder and Decoder

Encode URI components or complete URIs, decode UTF-8 percent escapes, and copy or download results in your browser. Includes encodeURIComponent and encodeURI outputs.

About URL Encoder and Decoder

Encode and decode UTF-8 text

Percent encoding represents selected UTF-8 bytes as a percent sign followed by two hexadecimal digits. For example, component encoding turns coffee & tea into coffee%20%26%20tea. A space becomes %20, and café becomes caf%C3%A9. Decoding restores the text in one pass.

Input and output lengths are counted in UTF-16 code units. These are not necessarily the same as visible characters: an emoji may use two or more code units.

Choose component encoding or URI encoding

Use encodeURIComponent for an individual query value or URI component. It leaves ASCII letters, digits and - _ . ! ~ * ' ( ) unchanged. Use encodeURI when URI separators should stay in place: it also preserves ; / ? : @ & = + $ , #. Both options encode square brackets.

For example, URI encoding changes https://example.com/search?q=iced tea&size=large to https://example.com/search?q=iced%20tea&size=large. If your query value contains an ampersand, encode that value separately with component encoding before adding it to the URL.

Neither option validates URLs, checks link safety or converts internationalized hostnames to Punycode. An existing percent sign becomes %25; do not blindly encode a URL that has already been encoded.

Decoding is not form parsing

This tool applies decodeURIComponent once. It preserves leading and trailing whitespace and literal plus signs. It does not parse application/x-www-form-urlencoded data or turn a plus sign into a space. It does not detect legacy character encodings. Malformed percent escapes, invalid UTF-8 byte sequences and unpaired surrogates produce an error without a partial result.

For example, coffee+tea%2Bmilk becomes coffee+tea+milk, while %2520 becomes %20. Only repeat decoding if the source format requires it. Decoding reserved characters can change how a URL is interpreted. Percent encoding is neither encryption nor HTML escaping.

Limits, moving results, copying and saving

Encoding accepts up to 100,000 UTF-16 code units. Decoding accepts up to 900,000, and each result is limited to 900,000. Over-limit input produces no result; reducing the input restores conversion. The largest encoding result can be moved to Decode mode. A decoded result longer than 100,000 code units cannot be moved to Encode mode; copy and split it into smaller parts.

Switching modes keeps your input. Use result and switch mode moves the component result when encoding, or the decoded result when decoding. Clear removes the input and results.

Copy or select a result to use it elsewhere. Line endings may change in the display or when pasted. Save UTF-8 starts a text-file download that preserves the result's line-ending bytes. It adds no byte order mark (BOM), but retains a BOM already present in the text. Starting a download does not confirm that your device saved the file.

If a clipboard operation is still pending, wait before copying anything else: the earlier operation could finish late and overwrite the clipboard. After about five seconds without confirmation, the tool shows an unconfirmed message. Background tabs or a sleeping device can delay that notice. The native write itself cannot be canceled.

The conversion tool does not send your input text to a server. The page still makes network requests for services such as advertising and usage measurement.

Frequently asked questions

Q. Which encoding result should I use?
Use encodeURIComponent for an individual query value or other URI component. Use encodeURI to preserve URI separators. Neither result verifies that a URL is valid or safe, and both leave ASCII letters, digits and some punctuation unchanged.
Q. What happens to spaces and plus signs?
Both encoding options turn spaces into %20. Decoding preserves literal + signs and leading or trailing whitespace. It does not apply the form-format rule that turns + into a space.
Q. Why does decoding fail?
Each percent sign must be followed by two hexadecimal digits, and the encoded bytes must form valid UTF-8. The tool does not automatically detect other encodings and also rejects unpaired surrogate code units.
Q. Does it undo double encoding automatically?
No. It decodes once: %2520 becomes %20. Repeating the operation may change the meaning of a URL, so check how the original data was encoded.
Q. What are the limits, and is my text uploaded?
Encoding input is limited to 100,000 UTF-16 code units; decoding input and each result are limited to 900,000. Switching modes preserves the input. The conversion tool does not upload your text, but advertising and usage measurement on the page can make network requests.

Sources and specifications

Related tools

Questions or feedback? Contact NanToo

Rate this tool
(0 ratings)