What This Tool Does

This tool percent-encodes any text so it's safe to use in URLs and query parameters, or decodes percent-encoded URLs back to readable form. It correctly handles spaces, accented characters, emoji, and reserved URL characters per RFC 3986.

Inputs Explained

How It Works

The tool uses encodeURIComponent() for component-level encoding (encodes all reserved characters) or encodeURI() for full-URL encoding (preserves the URL structure). Decoding uses decodeURIComponent().

Formula / Logic Used

Component: encodeURIComponent('a b&c') → a%20b%26c Full URL: encodeURI('https://x.com/p q') → https://x.com/p%20q

URL Encoder & Decoder

Encode special characters in URLs or decode percent-encoded URLs back to plain text.

Step-by-Step Example

Input: hello world & café

Component encoded: hello%20world%20%26%20caf%C3%A9

Full URL example: https://example.com/page?q=hello world

encodeURI output: https://example.com/page?q=hello%20world (preserves : / ? = &)

Use Cases

Assumptions and Limitations

Disclaimer: All conversions happen in your browser. URLs and text never leave your device.

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?

encodeURI preserves URL syntax characters (: / ? # & =) so the result is still a valid URL structure. encodeURIComponent encodes everything that isn't a basic alphanumeric, so it's safe for use as a single query value.

Why does space become %20 sometimes and + other times?

%20 is the standard percent encoding for a space. + is the older form-encoded representation used in application/x-www-form-urlencoded forms. Both decode to space, but they aren't always interchangeable in URL paths.

Will my URL data be sent anywhere?

No. Both encode and decode run entirely in your browser using native JavaScript. There is no backend call for the conversion.

Can I encode emoji in URLs?

Yes. UTF-8 emoji become multi-byte percent sequences. For example, 🌍 becomes %F0%9F%8C%8D. All major browsers handle this correctly when decoding.

What about double-encoded URLs?

If text was encoded twice (e.g., %2520 instead of %20), decode it twice. This commonly happens when URL parameters are passed through multiple systems that each encode the value.

Is URL encoding the same as Base64?

No. URL encoding (percent encoding) replaces unsafe characters with %XX hex codes. Base64 converts binary data into a 64-character alphabet. They serve different purposes.

Why does my decoded URL show 'malformed URI sequence' error?

The input contains invalid percent sequences. Each % must be followed by exactly two valid hex digits. Lone % characters or partial sequences cause the error.

Can I encode a full URL safely?

Use encodeURI for the URL as a whole, or encodeURIComponent for individual query values. Never apply encodeURIComponent to a full URL — it will encode the colons and slashes.

Sources and References

Related Calculators

Base64 Encoder DecoderJSON FormatterCase ConverterHTML Entities EncoderUUID GeneratorBinary & Hex Converter