URL Encoder & Decoder β Online Free
Percent-encode text for safe use in URLs and query parameters, or decode a percent-encoded URL back to readable text. Supports UTF-8, two encoding modes, live conversion.
What is URL encoding?
URL encoding (also called percent-encoding) replaces "unsafe" characters in a URL with %XX sequences where XX is the hex value of the character's byte. The reason: URLs can only safely use a limited set of ASCII characters. Spaces, accented letters, emojis, quotes, and many punctuation marks must be encoded to travel through HTTP servers, proxies and parsers without breaking. Encoded properly, Hello World! becomes Hello%20World%21 β completely safe in any URL.
Two main use cases: building URLs that include user-supplied text (search queries, form values, file names), and reading URLs that look garbled because the percent-encoded sequences need decoding to be human-readable.
Component vs full URI encoding
JavaScript provides two encoding functions; this tool exposes both:
encodeURIComponent(Component) β encodes every character that has special meaning in a URL. Use when encoding a value that goes into a query string parameter, form field, or path segment. Encodes: / ? # [ ] @ ! $ & ' ( ) * + , ; =and more.encodeURI(Full URI) β encodes only characters that aren't valid anywhere in a URL. Preserves the URL structure (protocol separator, slashes, query and fragment markers). Use when encoding an already-built URL that just needs special characters fixed.
If unsure, pick Component β it's safer. Use Full URI only when you have a complete URL like https://example.com/path?q=x and want to encode only the parts that are broken.
Common cases
- Search engine URLs β
https://google.com/search?q=hello%20world - URLs with non-ASCII content β accented characters, CJK scripts, emojis.
- File downloads β file names with spaces need encoding.
- OAuth redirects β the redirect_uri parameter must be URL-encoded.
- Webhook URLs with structured query parameters.
- Email mailto: links with pre-filled subject and body.
- Reading API documentation β examples often show URL-encoded values that need decoding to understand.
Common URL encoding pitfalls
- Double-encoding β encoding an already-encoded URL turns
%20into%2520. Decode first if unsure. - Forgetting that
+is space in query strings β Form encoding (application/x-www-form-urlencoded) uses+for space; standard URI encoding uses%20. Most decoders handle both. - Encoding the
=between parameter and value β only the value should be encoded, not the structural?and=. - UTF-8 confusion β modern web uses UTF-8 for the underlying bytes. Old systems sometimes use ISO-8859-1, producing different encoded output for the same character.
Tips
- For pasted URLs that look garbled (full of %XX), pick Decode and switch to Full URI mode.
- For values you'll embed into a URL you're building, pick Encode and Component mode.
- JavaScript's
encodeURIComponentdoesn't encode!'()*-._~β these are valid in URIs but some old systems still require them encoded. Manual fixup if needed.
FAQs
What's the difference between encodeURI and encodeURIComponent?
encodeURI preserves URL structure; encodeURIComponent encodes everything that's not a basic letter/number. Pick Component when encoding a value that goes inside a URL.
Why does my encoded URL still look broken?
You may need Component mode instead of Full URI. Component encodes more aggressively.
Is anything uploaded?
No. Runs in your browser.
Does it handle UTF-8 / Unicode?
Yes β JavaScript's native encoders use UTF-8 by default.